pub enum Result<T> {
Ok(T),
Err(Error),
}Expand description
Variants§
Implementations§
Source§impl<T> Result<T>
impl<T> Result<T>
Sourcepub fn ok(self) -> Option<T>
pub fn ok(self) -> Option<T>
Converts from Result<T> to Option<T>.
Converts self into an Option<T>, consuming self,
and discarding the error, if any.
Sourcepub fn err(self) -> Option<Error>
pub fn err(self) -> Option<Error>
Converts from Result<T> to Option<Error>.
Converts self into an Option<Error>, consuming self,
and discarding the success value, if any.
Sourcepub fn unwrap_or_else<F: FnOnce(Error) -> T>(self, op: F) -> T
pub fn unwrap_or_else<F: FnOnce(Error) -> T>(self, op: F) -> T
Returns the contained Ok value or computes it from a closure.
pub fn unwrap_or_panic(self) -> T
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Result<T>where
T: Freeze,
impl<T> RefUnwindSafe for Result<T>where
T: RefUnwindSafe,
impl<T> Send for Result<T>where
T: Send,
impl<T> Sync for Result<T>where
T: Sync,
impl<T> Unpin for Result<T>where
T: Unpin,
impl<T> UnwindSafe for Result<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more