Trait memflow::error::PartialResultExt
source · pub trait PartialResultExt<T> {
// Required methods
fn data(self) -> Result<T>;
fn data_part(self) -> Result<T>;
fn map_data<U, F: FnOnce(T) -> U>(self, func: F) -> PartialResult<U>;
}
Expand description
Specialized PartialResult
extension for results.
Required Methods§
sourcefn data(self) -> Result<T>
fn data(self) -> Result<T>
Tries to extract the data from the Result
.
This will return a full error even if a partial error happened.
sourcefn data_part(self) -> Result<T>
fn data_part(self) -> Result<T>
Tries to extract the data or partial data from the Result
.
This will return a full error only if a hard error happened.
A partial error will be converted to an Ok(T)
.
sourcefn map_data<U, F: FnOnce(T) -> U>(self, func: F) -> PartialResult<U>
fn map_data<U, F: FnOnce(T) -> U>(self, func: F) -> PartialResult<U>
Maps the data contained in the partial result to another result. This is especially useful if you want to return a different result type but want to keep the partial result information.
Object Safety§
This trait is not object safe.