pub struct ModelRoot {
pub id: ModelId,
pub name: Name,
pub fields: Vec<Field>,
pub primary_key: PrimaryKey,
pub table_name: Option<String>,
pub indices: Vec<Index>,
}Fields§
§id: ModelIdUniquely identifies the model within the schema
name: NameName of the model
fields: Vec<Field>Fields contained by the model
primary_key: PrimaryKeyThe primary key for this model. Root models must have a primary key.
table_name: Option<String>If the schema specifies a table to map the model to, this is set.
indices: Vec<Index>Indices defined on this model.
Implementations§
Source§impl ModelRoot
impl ModelRoot
pub fn find_by_id(&self, input: impl Input) -> Query
Sourcepub fn primary_key_fields(&self) -> impl ExactSizeIterator<Item = &Field>
pub fn primary_key_fields(&self) -> impl ExactSizeIterator<Item = &Field>
Iterate over the fields used for the model’s primary key.
pub fn field_by_name(&self, name: &str) -> Option<&Field>
Trait Implementations§
Source§impl<'a, T> IntoExprTarget<'a, T> for &'a ModelRoot
impl<'a, T> IntoExprTarget<'a, T> for &'a ModelRoot
fn into_expr_target(self, _schema: &'a T) -> ExprTarget<'a>
Auto Trait Implementations§
impl Freeze for ModelRoot
impl RefUnwindSafe for ModelRoot
impl Send for ModelRoot
impl Sync for ModelRoot
impl Unpin for ModelRoot
impl UnwindSafe for ModelRoot
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