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})
const
factory
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
stderr decoded as UTF-8, replacing malformed sequences.
no setter
stderrTruncated bool
Whether stderr hit the capture limit.
no setterinherited
stdout Uint8List
Captured standard output.
no setterinherited
stdoutText String
stdout decoded as UTF-8, replacing malformed sequences.
no setter
stdoutTruncated bool
Whether stdout hit the capture limit.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_PrivCommandResult value)) → TResult

Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_PrivCommandResult value)?) → TResult?

Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_PrivCommandResult value)?, {required TResult orElse()}) → TResult

Available on PrivCommandResult, provided by the PrivCommandResultPatterns extension

A variant of map that fallback to returning orElse.
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 of when that fallback to an orElse callback.
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

A switch-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 of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited