Struct fluence::MountedBinaryResult[][src]

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

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, Global>

The data that the process wrote to stdout.

stderr: Vec<u8, Global>

The data that the process wrote to stderr.

Implementations

impl Result[src]

pub fn from_error(ret_code: i32, error: impl Into<String>) -> Result[src]

Create a new failure MountedBinaryResult from the provided ret_code.

pub fn is_success(&self) -> bool[src]

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

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

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.

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

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.

pub fn stringify(&self) -> Option<StringResult>[src]

Trait Implementations

impl Clone for Result[src]

impl Debug for Result[src]

impl Default for Result[src]

impl<'de> Deserialize<'de> for Result[src]

impl Eq for Result[src]

impl PartialEq<Result> for Result[src]

impl Serialize for Result[src]

impl StructuralEq for Result[src]

impl StructuralPartialEq for Result[src]

Auto Trait Implementations

impl RefUnwindSafe for Result

impl Send for Result

impl Sync for Result

impl Unpin for Result

impl UnwindSafe for Result

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.