pub type WithResult<O, T, E> = With<O, Result<T, E>>;Expand description
Aliased Type§
#[repr(C)]pub struct WithResult<O, T, E> {
pub value: O,
pub with: Result<T, E>,
}Fields§
§value: O§with: Result<T, E>Implementations§
Source§impl<O, T, E> WithResult<O, T, E>
impl<O, T, E> WithResult<O, T, E>
Sourcepub fn take(self) -> Result<T, E>
pub fn take(self) -> Result<T, E>
Converts WithResult into Result by unwraping self.
Sourcepub const fn is_ok(&self) -> bool
pub const fn is_ok(&self) -> bool
See Result::is_ok.
Sourcepub const fn is_err(&self) -> bool
pub const fn is_err(&self) -> bool
See Result::is_err.
Sourcepub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool
pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool
See Result::is_err_and.
Sourcepub fn ok(self) -> Option<T>
pub fn ok(self) -> Option<T>
See Result::ok.
Sourcepub fn err(self) -> Option<E>
pub fn err(self) -> Option<E>
See Result::err.
Sourcepub fn map<F, U>(self, op: F) -> WithResult<O, U, E>where
F: FnOnce(T) -> U,
pub fn map<F, U>(self, op: F) -> WithResult<O, U, E>where
F: FnOnce(T) -> U,
Applies the given function to the result. See Result::map.
Sourcepub fn map_err<F, D>(self, op: F) -> WithResult<O, T, D>where
F: FnOnce(E) -> D,
pub fn map_err<F, D>(self, op: F) -> WithResult<O, T, D>where
F: FnOnce(E) -> D,
Applies the given function to the result. See Result::map_err.
Sourcepub fn expect(self, msg: &str) -> Twhere
E: Debug,
pub fn expect(self, msg: &str) -> Twhere
E: Debug,
See Result::expect.
Sourcepub fn unwrap(self) -> Twhere
E: Debug,
pub fn unwrap(self) -> Twhere
E: Debug,
See Result::unwrap.