Skip to main content

TryAsMut

Trait TryAsMut 

Source
pub trait TryAsMut<T: ?Sized> {
    // Required method
    fn try_as_mut(&mut self) -> Option<&mut T>;
}
Expand description

Used to get a mutable reference of the inner type if possible.

Required Methods§

Source

fn try_as_mut(&mut self) -> Option<&mut T>

Tries to convert this type into a mutable reference of the (usually inferred) input type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: ?Sized> TryAsMut<T> for Arc<T>

Source§

fn try_as_mut(&mut self) -> Option<&mut T>

Implementors§