pub trait TypedView<'a>: Sized + Copy {
const CLASS: ClassId;
// Required methods
fn from_object(object: &'a Object) -> Self;
fn object(&self) -> &'a Object;
// Provided methods
fn try_from_object(schema: &Schema, object: &'a Object) -> Option<Self> { ... }
fn mrid(&self) -> &'a Mrid { ... }
}Expand description
A typed view over an Object of a known class.
Required Associated Constants§
Required Methods§
Sourcefn from_object(object: &'a Object) -> Self
fn from_object(object: &'a Object) -> Self
Wrap an object without checking its class.
Provided Methods§
Sourcefn try_from_object(schema: &Schema, object: &'a Object) -> Option<Self>
fn try_from_object(schema: &Schema, object: &'a Object) -> Option<Self>
Wrap an object only if its class matches, including subclasses.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".