UniResult

Type Alias UniResult 

Source
pub type UniResult<T, K> = Result<T, UniError<K>>;
Expand description

A result type that specifies a customkind.

Aliased Type§

pub enum UniResult<T, K> {
    Ok(T),
    Err(UniError<K>),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(UniError<K>)

Contains the error value

Trait Implementations§

Source§

impl<K: UniKind, K2: UniKind, T> ResultContext<K2, T, K> for UniResult<T, K>

Source§

fn kind(self, kind: K2) -> UniResult<T, K2>

Wraps the existing result error with the provided kind.
Source§

fn context(self, context: impl Into<Cow<'static, str>>) -> UniResult<T, K2>
where K2: Default,

Wraps the existing result error with the provided context.
Source§

fn kind_context( self, kind: K2, context: impl Into<Cow<'static, str>>, ) -> UniResult<T, K2>

Wraps the existing result error with the provided kind and context.
Source§

fn wrap(self) -> UniResult<T, K2>
where K2: Default,

Wraps the existing result error with no additional context.
Source§

fn kind_fn<F>(self, kind: F) -> UniResult<T, K>
where F: FnOnce(&Self) -> K, Self: Sized,

Wraps the existing result error with the provided kind.
Source§

fn context_fn<F, S>(self, context: F) -> UniResult<T, K>
where F: FnOnce(&Self) -> S, S: Into<Cow<'static, str>>, K: Default, Self: Sized,

Wraps the existing result error with the provided context.
Source§

fn kind_context_fn<F, F2, S>(self, kind: F, context: F2) -> UniResult<T, K>
where F: FnOnce(&Self) -> K, F2: FnOnce(&Self) -> S, S: Into<Cow<'static, str>>, Self: Sized,

Wraps the existing result error with the provided kind and context.