pub struct MountedBinaryResult {
    pub ret_code: i32,
    pub error: String,
    pub stdout: Vec<u8>,
    pub stderr: Vec<u8>,
}
Expand description

Describes result of calling a CLI service.

Fields§

§ret_code: i32

Return process exit code or host execution error code, where SUCCESS_CODE means success.

§error: String

Contains the string representation of an error, if ret_code != SUCCESS_CODE.

§stdout: Vec<u8>

The data that the process wrote to stdout.

§stderr: Vec<u8>

The data that the process wrote to stderr.

Implementations§

source§

impl MountedBinaryResult

source

pub fn from_error(ret_code: i32, error: impl Into<String>) -> Self

Create a new failure MountedBinaryResult from the provided ret_code.

source

pub fn is_success(&self) -> bool

Return true, if this Result represents a success result, otherwise false.

source

pub fn into_std(self) -> Option<Result<String, String>>

This function tries to transform a result to the string representation. Internally, It checks ret_code and returns either Some(Ok(stdout)) if it was SUCCESS_CODE or Some(Err(error)) otherwise. None is returned if stdout or stderr contains non valid UTF8 string.

source

pub fn as_std(&self) -> Option<Result<String, String>>

This function tries to represent a result as a string. Internally, It checks ret_code and returns either Some(Ok(stdout)) if it was SUCCESS_CODE or Some(Err(error)) otherwise. None is returned if stdout or stderr contains non valid UTF8 string.

source

pub fn stringify(&self) -> Option<MountedBinaryStringResult>

Trait Implementations§

source§

impl Clone for MountedBinaryResult

source§

fn clone(&self) -> MountedBinaryResult

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MountedBinaryResult

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MountedBinaryResult

source§

fn default() -> MountedBinaryResult

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for MountedBinaryResult

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for MountedBinaryResult

source§

fn eq(&self, other: &MountedBinaryResult) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for MountedBinaryResult

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for MountedBinaryResult

source§

impl StructuralPartialEq for MountedBinaryResult

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,