Skip to main content

WritableResultExt

Trait WritableResultExt 

Source
pub trait WritableResultExt<T, E>: Writable<Target = Result<T, E>> {
    // Provided methods
    fn unwrap_mut(
        &mut self,
    ) -> WriteLock<'_, T, Self::Storage, Self::WriteMetadata>
       where T: 'static,
             E: 'static { ... }
    fn as_mut(
        &mut self,
    ) -> Result<WriteLock<'_, T, Self::Storage, Self::WriteMetadata>, WriteLock<'_, E, Self::Storage, Self::WriteMetadata>>
       where T: 'static,
             E: 'static { ... }
}
Available on crate feature prelude only.
Expand description

An extension trait for Writable<Result<T, E>> that provides some convenience methods.

Provided Methods§

Source

fn unwrap_mut(&mut self) -> WriteLock<'_, T, Self::Storage, Self::WriteMetadata>
where T: 'static, E: 'static,

Unwraps the inner value mutably, panicking if the Result is an error.

Source

fn as_mut( &mut self, ) -> Result<WriteLock<'_, T, Self::Storage, Self::WriteMetadata>, WriteLock<'_, E, Self::Storage, Self::WriteMetadata>>
where T: 'static, E: 'static,

Attempts to mutably access the inner value of the Result.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, E, W> WritableResultExt<T, E> for W
where W: Writable<Target = Result<T, E>>,