[][src]Trait memflow::error::PartialResultExt

pub trait PartialResultExt<T> {
    fn data(self) -> Result<T>;
fn data_part(self) -> Result<T>;
fn map_data<U, F: FnOnce(T) -> U>(self, func: F) -> PartialResult<U>; }

Specialized PartialResult exntesion for results.

Required methods

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.

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).

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.

Loading content...

Implementors

impl<T> PartialResultExt<T> for PartialResult<T>[src]

Loading content...