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§
type BorrowedPrimaryKey: ?Sized + ToOwned<Owned = Self::PrimaryKey>
Required Methods§
Sourcefn borrow_primary_key(&self) -> &Self::BorrowedPrimaryKey
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".