pub enum Result<T> {
Ok(T),
Err(Error),
}
Expand description
Variants§
Implementations§
Source§impl<T> Result<T>
impl<T> Result<T>
Sourcepub fn unwrap(self) -> T
pub fn unwrap(self) -> T
Returns the contained Ok
value, consuming the self
value.
Because this function may rollback, its use is generally discouraged.
Instead, prefer to use pattern matching and handle the Err
case explicitly.
§Rollbacks
Rollbacks if the value is an Err
, with a “error” and error code provided by the
Err
’s value.
Sourcepub unsafe fn unwrap_unchecked(self) -> T
pub unsafe fn unwrap_unchecked(self) -> T
Returns the contained Ok
value, consuming the self
value,
without checking that the value is not an Err
.
§Safety
Calling this method on an Err
is undefined behavior.
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