pub struct PrimaryKey {
pub fields: Vec<FieldId>,
pub index: IndexId,
}Expand description
The primary key definition for a root model.
A primary key consists of one or more fields that uniquely identify a
record, plus a reference to the backing Index.
§Examples
use toasty_core::schema::app::{PrimaryKey, IndexId, ModelId};
let pk = PrimaryKey {
fields: vec![ModelId(0).field(0)],
index: IndexId { model: ModelId(0), index: 0 },
};
assert_eq!(pk.fields.len(), 1);Fields§
§fields: Vec<FieldId>The fields that compose this primary key, in order.
index: IndexIdThe IndexId of the index backing this primary key.
Trait Implementations§
Source§impl Clone for PrimaryKey
impl Clone for PrimaryKey
Source§fn clone(&self) -> PrimaryKey
fn clone(&self) -> PrimaryKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrimaryKey
impl RefUnwindSafe for PrimaryKey
impl Send for PrimaryKey
impl Sync for PrimaryKey
impl Unpin for PrimaryKey
impl UnwindSafe for PrimaryKey
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