Struct parser_database::ast::Model
source · pub struct Model {
pub attributes: Vec<Attribute>,
/* private fields */
}
Expand description
A model declaration.
Fields§
§attributes: Vec<Attribute>
The attributes of this model.
ⓘ
model Foo {
id Int @id
field String
@@index([field])
^^^^^^^^^^^^^^^^
@@map("Bar")
^^^^^^^^^^^^
}
Implementations§
source§impl Model
impl Model
pub fn iter_fields(&self) -> impl ExactSizeIterator + Clone
pub fn is_view(&self) -> bool
Trait Implementations§
source§impl WithAttributes for Model
impl WithAttributes for Model
source§fn attributes(&self) -> &[Attribute]
fn attributes(&self) -> &[Attribute]
The attributes.
source§impl WithDocumentation for Model
impl WithDocumentation for Model
source§fn documentation(&self) -> Option<&str>
fn documentation(&self) -> Option<&str>
The documentation string, if defined.
source§impl WithIdentifier for Model
impl WithIdentifier for Model
source§fn identifier(&self) -> &Identifier
fn identifier(&self) -> &Identifier
The identifier.
Auto Trait Implementations§
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