pub trait TypeInfo: DynamicTypeInfo {
const TYPE: Type;
// Provided methods
fn field<A>(&self, _id: FieldId<'_>) -> Option<&A>
where A: Any { ... }
fn field_mut<A>(&mut self, _id: FieldId<'_>) -> Option<&mut A>
where A: Any { ... }
}
Expand description
A type that has compile-time static type information associated with it.
Required Associated Constants§
Provided Methods§
Sourcefn field<A>(&self, _id: FieldId<'_>) -> Option<&A>where
A: Any,
fn field<A>(&self, _id: FieldId<'_>) -> Option<&A>where
A: Any,
Get a reference to the value of a field on this type with the given field id.
This method will return the current value of the given field if possible, or None
if the
given field does not exist or does not have a type matching the supplied type.
Sourcefn field_mut<A>(&mut self, _id: FieldId<'_>) -> Option<&mut A>where
A: Any,
fn field_mut<A>(&mut self, _id: FieldId<'_>) -> Option<&mut A>where
A: Any,
Get a mutable reference to the value of a field on this type with the given field id.
This method will return the current value of the given field if possible, or None
if the
given field does not exist or does not have a type matching the supplied type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.