pub struct Model { /* private fields */ }
Implementations§
Source§impl Model
impl Model
Sourcepub fn new(id: u64, name: String, fields: Vec<Field>) -> Result<Self>
pub fn new(id: u64, name: String, fields: Vec<Field>) -> Result<Self>
Creates a new model with validation
Sourcepub fn field_ref(&self, name: &str) -> Option<FieldRef<'_>>
pub fn field_ref(&self, name: &str) -> Option<FieldRef<'_>>
Get a strongly-typed reference to a field
Sourcepub fn front_field(&self) -> Option<FieldRef<'_>>
pub fn front_field(&self) -> Option<FieldRef<'_>>
Gets the “front” field as a FieldRef if it can be determined
Sourcepub fn back_field(&self) -> Option<FieldRef<'_>>
pub fn back_field(&self) -> Option<FieldRef<'_>>
Gets the “back” field as a FieldRef if it can be determined
Trait Implementations§
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more