app/lib/common/rust/api/rs_process.dart

55 lines
1.5 KiB
Dart
Raw Normal View History

2024-04-16 22:34:50 +08:00
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.32.
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
2024-04-17 21:40:08 +08:00
// The type `RsProcess` is not used by any `pub` functions, thus it is ignored.
Stream<RsProcessStreamData> start(
{required String executable,
required List<String> arguments,
required String workingDirectory,
dynamic hint}) =>
RustLib.instance.api.start(
executable: executable,
arguments: arguments,
workingDirectory: workingDirectory,
hint: hint);
Future<void> write({required int rsPid, required String data, dynamic hint}) =>
RustLib.instance.api.write(rsPid: rsPid, data: data, hint: hint);
2024-04-16 22:34:50 +08:00
class RsProcessStreamData {
final RsProcessStreamDataType dataType;
final String data;
2024-04-17 21:40:08 +08:00
final int rsPid;
2024-04-16 22:34:50 +08:00
const RsProcessStreamData({
required this.dataType,
required this.data,
2024-04-17 21:40:08 +08:00
required this.rsPid,
2024-04-16 22:34:50 +08:00
});
@override
2024-04-17 21:40:08 +08:00
int get hashCode => dataType.hashCode ^ data.hashCode ^ rsPid.hashCode;
2024-04-16 22:34:50 +08:00
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is RsProcessStreamData &&
runtimeType == other.runtimeType &&
dataType == other.dataType &&
2024-04-17 21:40:08 +08:00
data == other.data &&
rsPid == other.rsPid;
2024-04-16 22:34:50 +08:00
}
enum RsProcessStreamDataType {
output,
error,
exit,
;
}