Struct datamodel_renderer::datamodel::IdDefinition
source · pub struct IdDefinition<'a>(/* private fields */);
Expand description
Defines the id attribute in a model block.
Implementations§
source§impl<'a> IdDefinition<'a>
impl<'a> IdDefinition<'a>
sourcepub fn new(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
pub fn new(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
Sets the model’s primary key to the given fields.
ⓘ
@@id([foo, bar])
// ^^^^^^^^^^ here
sourcepub fn name(&mut self, name: impl Into<Cow<'a, str>>)
pub fn name(&mut self, name: impl Into<Cow<'a, str>>)
Sets a client name for the id.
ⓘ
@@id([foo, bar], name: "Foo")
// ^^^^^ here
Trait Implementations§
source§impl<'a> Debug for IdDefinition<'a>
impl<'a> Debug for IdDefinition<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for IdDefinition<'a>
impl<'a> Send for IdDefinition<'a>
impl<'a> Sync for IdDefinition<'a>
impl<'a> Unpin for IdDefinition<'a>
impl<'a> UnwindSafe for IdDefinition<'a>
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