pub struct RelationDef {
pub name: String,
pub relation_type: RelationType,
pub class_name: String,
pub collection: String,
pub foreign_key: String,
pub polymorphic_type_field: Option<String>,
pub polymorphic_type_value: Option<String>,
}Expand description
Definition of a single relationship.
Fields§
§name: StringThe name used in DSL calls, e.g. “posts”, “profile”, “user”
relation_type: RelationTypeThe type of relationship
class_name: StringThe related model class name, e.g. “Post”, “Profile”, “User”
collection: StringThe collection name for the related model, e.g. “posts”, “profiles”, “users”
foreign_key: StringThe foreign key field, e.g. “user_id”
polymorphic_type_field: Option<String>For polymorphic relations: the field storing the type (e.g., “commentable_type”)
polymorphic_type_value: Option<String>For polymorphic relations: the expected type value (e.g., “Post”)
Trait Implementations§
Source§impl Clone for RelationDef
impl Clone for RelationDef
Source§fn clone(&self) -> RelationDef
fn clone(&self) -> RelationDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RelationDef
impl RefUnwindSafe for RelationDef
impl Send for RelationDef
impl Sync for RelationDef
impl Unpin for RelationDef
impl UnsafeUnpin for RelationDef
impl UnwindSafe for RelationDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more