Struct marine_rs_sdk::MountedBinaryResult
source · 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
impl MountedBinaryResult
sourcepub fn from_error(ret_code: i32, error: impl Into<String>) -> Self
pub fn from_error(ret_code: i32, error: impl Into<String>) -> Self
Create a new failure MountedBinaryResult from the provided ret_code.
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Return true, if this Result represents a success result, otherwise false.
sourcepub fn into_std(self) -> Option<Result<String, String>>
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.
sourcepub fn as_std(&self) -> Option<Result<String, String>>
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.
pub fn stringify(&self) -> Option<MountedBinaryStringResult>
Trait Implementations§
source§impl Clone for MountedBinaryResult
impl Clone for MountedBinaryResult
source§fn clone(&self) -> MountedBinaryResult
fn clone(&self) -> MountedBinaryResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MountedBinaryResult
impl Debug for MountedBinaryResult
source§impl Default for MountedBinaryResult
impl Default for MountedBinaryResult
source§fn default() -> MountedBinaryResult
fn default() -> MountedBinaryResult
source§impl<'de> Deserialize<'de> for MountedBinaryResult
impl<'de> Deserialize<'de> for MountedBinaryResult
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for MountedBinaryResult
impl PartialEq for MountedBinaryResult
source§fn eq(&self, other: &MountedBinaryResult) -> bool
fn eq(&self, other: &MountedBinaryResult) -> bool
self
and other
values to be equal, and is used
by ==
.