pub trait RelationMeta {
type Owner: Model;
type Target: Model;
const NAME: &'static str;
const KIND: RelationKind;
const LOCAL_KEY: &'static str;
const FOREIGN_KEY: &'static str;
}Expand description
Each relation emitted by codegen materializes as a zero-sized type
implementing this trait. Owner is the model declaring the relation;
Target is the related model. LOCAL_KEY is the column on Owner
that references Target (for BelongsTo); FOREIGN_KEY is the
column on Target that references Owner’s PK (for HasMany /
HasOne).
Required Associated Constants§
Sourceconst NAME: &'static str
const NAME: &'static str
Field name on Owner (also the string key of the matching
super::IncludeSpec).
Sourceconst KIND: RelationKind
const KIND: RelationKind
Classification of this relation (see RelationKind).
Sourceconst LOCAL_KEY: &'static str
const LOCAL_KEY: &'static str
Column on Owner that references Target (used for
BelongsTo). For HasMany / HasOne this is conventionally
"id".
Sourceconst FOREIGN_KEY: &'static str
const FOREIGN_KEY: &'static str
Column on Target that references Owner’s PK (used for
HasMany / HasOne). For BelongsTo this is conventionally
"id".
Required Associated Types§
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.