Skip to main content

ValueTryAsMutObject

Trait ValueTryAsMutObject 

Source
pub trait ValueTryAsMutObject {
    type Object;

    // Required method
    fn try_as_object_mut(&mut self) -> Result<&mut Self::Object, TryTypeError>;
}
Expand description

Mutatability for Object values

Required Associated Types§

Source

type Object

The type for Objects

Required Methods§

Source

fn try_as_object_mut(&mut self) -> Result<&mut Self::Object, TryTypeError>

Tries to represent the value as an object and returns a mutable reference to it

§Errors

if the requested type doesn’t match the actual type

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§