pub trait Field<F> {
type Child;
const SOURCE: &'static [&'static str];
// Required methods
fn get(&self) -> &Self::Child;
fn get_mut(&mut self) -> &mut Self::Child;
}Expand description
Access a composite field route and describe its child type and source spellings.
Each eligible field has a nominal marker generated by the composite macro.
Use crate::field! to name a field or an arbitrarily nested route, such as
field!(Composite::field::nested). The marker need not be named directly.
The child is the exact authored field type in the parent declaration scope.
Imported aliases and associated/generic child types retain Rust identity.
Ordinary state fields do not participate in field routes or capability lifting.
Without program-image-execution, legacy #[loadable] fields also stop route
traversal and capability lifting; their sections are loaded separately.
Use this trait in bounds on consumers of field routes. Implementations are
supplied by crate::composite and the generated route traversal.
Required Associated Constants§
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".