Skip to main content

ValueTryAsObject

Trait ValueTryAsObject 

Source
pub trait ValueTryAsObject {
    type Object: Object;

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

try_as_* access to object value types

Required Associated Types§

Source

type Object: Object

The object structure

Required Methods§

Source

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

Tries to represent the value as an object and returns a 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§