Skip to main content

BorrowPrimaryKey

Trait BorrowPrimaryKey 

Source
pub trait BorrowPrimaryKey: PrimaryKey {
    type BorrowedPrimaryKey<'a>: Copy + Send + Sync + Into<<Self as PrimaryKey>::PrimaryKey>
       where Self: 'a;

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

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

i.e. &str, &[u8], or a type with one or more borrowed fields.

Required Associated Types§

Source

type BorrowedPrimaryKey<'a>: Copy + Send + Sync + Into<<Self as PrimaryKey>::PrimaryKey> where Self: 'a

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§