Type Alias memflow::error::PartialResult
source · pub type PartialResult<T> = Result<T, PartialError<T>>;
Expand description
Specialized PartialResult
type for memflow results with recoverable errors.
Aliased Type§
enum PartialResult<T> {
Ok(T),
Err(PartialError<T>),
}
Variants§
Trait Implementations§
source§impl<T> PartialResultExt<T> for PartialResult<T>
impl<T> PartialResultExt<T> for PartialResult<T>
source§fn 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.source§fn 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)
.source§fn 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.