Skip to main content

GetField

Trait GetField 

Source
pub trait GetField<F: Field>: Patch {
    // Required methods
    fn get_field(self) -> F::Type;
    fn borrow_field(&self) -> &F::Type;
    fn borrow_field_mut(&mut self) -> &mut F::Type;
}
Expand description

Generic access to a patch’s fields

This enables generic code to check if a patch contains a certain field (for example the model’s primary key, see Identifiable) and gain access to it.

Required Methods§

Source

fn get_field(self) -> F::Type

Take the field by ownership

Source

fn borrow_field(&self) -> &F::Type

Borrow the field

Source

fn borrow_field_mut(&mut self) -> &mut F::Type

Borrow the field mutably

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§