Struct datamodel_renderer::datamodel::IndexDefinition
source · pub struct IndexDefinition<'a>(/* private fields */);
Expand description
Defines an index in a model block.
Implementations§
source§impl<'a> IndexDefinition<'a>
impl<'a> IndexDefinition<'a>
sourcepub fn index(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
pub fn index(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
A normal index, defined as @@index
.
sourcepub fn unique(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
pub fn unique(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
A unique constraint, defined as @@unique
.
sourcepub fn fulltext(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
pub fn fulltext(fields: impl Iterator<Item = IndexFieldInput<'a>>) -> Self
A fulltext index, defined as @@fulltext
.
sourcepub fn name(&mut self, name: impl Into<Cow<'a, str>>)
pub fn name(&mut self, name: impl Into<Cow<'a, str>>)
The client name of the index, defined as the name
argument
inside the attribute.
sourcepub fn map(&mut self, map: impl Into<Cow<'a, str>>)
pub fn map(&mut self, map: impl Into<Cow<'a, str>>)
The constraint name in the database, defined as the map
argument inside the attribute.
sourcepub fn clustered(&mut self, clustered: bool)
pub fn clustered(&mut self, clustered: bool)
Defines the clustered
argument inside the attribute.
sourcepub fn index_type(&mut self, index_type: impl Into<Cow<'a, str>>)
pub fn index_type(&mut self, index_type: impl Into<Cow<'a, str>>)
Defines the type
argument inside the attribute.
Trait Implementations§
source§impl<'a> Debug for IndexDefinition<'a>
impl<'a> Debug for IndexDefinition<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for IndexDefinition<'a>
impl<'a> Send for IndexDefinition<'a>
impl<'a> Sync for IndexDefinition<'a>
impl<'a> Unpin for IndexDefinition<'a>
impl<'a> UnwindSafe for IndexDefinition<'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