Trait butane::AsPrimaryKey

source ·
pub trait AsPrimaryKey<T>where
    T: DataObject,{
    // Required method
    fn as_pk(&self) -> Cow<'_, <T as DataObject>::PKType>;
}
Expand description

Trait for referencing the primary key for a given model. Used to implement ForeignKey equality tests.

Required Methods§

source

fn as_pk(&self) -> Cow<'_, <T as DataObject>::PKType>

Implementors§

source§

impl<P, T> AsPrimaryKey<T> for Pwhere P: PrimaryKeyType, T: DataObject<PKType = P>,

source§

impl<T> AsPrimaryKey<T> for ForeignKey<T>where T: DataObject,