BorrowPrimaryKey

Trait BorrowPrimaryKey 

Source
pub trait BorrowPrimaryKey: PrimaryKey {
    type BorrowedPrimaryKey: ?Sized + ToOwned<Owned = Self::PrimaryKey>;

    // Required method
    fn borrow_primary_key(&self) -> &Self::BorrowedPrimaryKey;
}
Expand description

Something whose primary key can be borrowed as a distinct type.

i.e. String, Vec<u8>, etc.

Required Associated Types§

Required Methods§

Source

fn borrow_primary_key(&self) -> &Self::BorrowedPrimaryKey

Borrow this entity’s primary key without copying any data.

This borrowed key has a lifetime tied to that of this entity.

Implementors§