pub enum AnyRelationship {
ForeignKey(Relationship),
Computed(ComputedRelationship),
}Expand description
Either a FK relationship or computed relationship
Used to represent any type of relationship in a unified way.
Variants§
ForeignKey(Relationship)
Standard foreign key relationship
Computed(ComputedRelationship)
Function-based computed relationship
Implementations§
Source§impl AnyRelationship
impl AnyRelationship
Sourcepub fn table(&self) -> &QualifiedIdentifier
pub fn table(&self) -> &QualifiedIdentifier
Get the source table
Sourcepub fn foreign_table(&self) -> &QualifiedIdentifier
pub fn foreign_table(&self) -> &QualifiedIdentifier
Get the target/foreign table
Sourcepub fn is_computed(&self) -> bool
pub fn is_computed(&self) -> bool
Check if this is a computed relationship
Sourcepub fn as_fk(&self) -> Option<&Relationship>
pub fn as_fk(&self) -> Option<&Relationship>
Get the foreign key relationship if this is one
Sourcepub fn as_computed(&self) -> Option<&ComputedRelationship>
pub fn as_computed(&self) -> Option<&ComputedRelationship>
Get the computed relationship if this is one
Trait Implementations§
Source§impl Clone for AnyRelationship
impl Clone for AnyRelationship
Source§fn clone(&self) -> AnyRelationship
fn clone(&self) -> AnyRelationship
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 moreSource§impl Debug for AnyRelationship
impl Debug for AnyRelationship
Source§impl From<ComputedRelationship> for AnyRelationship
impl From<ComputedRelationship> for AnyRelationship
Source§fn from(r: ComputedRelationship) -> Self
fn from(r: ComputedRelationship) -> Self
Converts to this type from the input type.
Source§impl From<Relationship> for AnyRelationship
impl From<Relationship> for AnyRelationship
Source§fn from(r: Relationship) -> Self
fn from(r: Relationship) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AnyRelationship
impl RefUnwindSafe for AnyRelationship
impl Send for AnyRelationship
impl Sync for AnyRelationship
impl Unpin for AnyRelationship
impl UnsafeUnpin for AnyRelationship
impl UnwindSafe for AnyRelationship
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