PrivCommandResult class abstract
Captured output and exit status of a finished command.
Returned by PrivKit.runCommand, which drains stdout and stderr
concurrently and bounds each capture at maxBytesPerStream. Excess bytes
are still drained so the process can exit, and the matching truncated
flag becomes true.
- Available extensions
- Annotations
-
- @freezed
Constructors
- PrivCommandResult({required int exitCode, required Uint8List stdout, required Uint8List stderr, @Default.new(false) bool stdoutTruncated, @Default.new(false) bool stderrTruncated})
-
constfactory
- PrivCommandResult.fromMap(Map map)
-
Decodes the map sent by the Android side.
factory
Properties
-
copyWith
→ $PrivCommandResultCopyWith<
PrivCommandResult> -
Create a copy of PrivCommandResult
with the given fields replaced by the non-null parameter values.
no setterinherited
- exitCode → int
-
Process exit code. Non-zero values are normal exits, not errors.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stderr → Uint8List
-
Captured standard error.
no setterinherited
- stderrText → String
-
stderrdecoded as UTF-8, replacing malformed sequences.no setter - stderrTruncated → bool
-
Whether
stderrhit the capture limit.no setterinherited - stdout → Uint8List
-
Captured standard output.
no setterinherited
- stdoutText → String
-
stdoutdecoded as UTF-8, replacing malformed sequences.no setter - stdoutTruncated → bool
-
Whether
stdouthit the capture limit.no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_PrivCommandResult value)) → TResult -
Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_PrivCommandResult value)?) → TResult? -
Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_PrivCommandResult value)?, {required TResult orElse()}) → TResult -
Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(int exitCode, Uint8List stdout, Uint8List stderr, bool stdoutTruncated, bool stderrTruncated)?, {required TResult orElse()}) → TResult -
Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(int exitCode, Uint8List stdout, Uint8List stderr, bool stdoutTruncated, bool stderrTruncated)) → TResult -
Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(int exitCode, Uint8List stdout, Uint8List stderr, bool stdoutTruncated, bool stderrTruncated)?) → TResult? -
Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension
A variant ofwhenthat fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited