pub struct Relation { /* private fields */ }Implementations§
Source§impl Relation
impl Relation
pub fn new<SS: Into<String>>( to_table_name: SS, to_column_name: SS, from_table_name: SS, from_column_name: SS, relation_type: RelationType, disable_usage_checking: bool, ) -> Self
Sourcepub fn new_composite<SS: Into<String>>(
to_table_name: SS,
from_table_name: SS,
column_pairs: Vec<(SS, SS)>,
relation_type: RelationType,
disable_usage_checking: bool,
) -> Result<Self, String>
pub fn new_composite<SS: Into<String>>( to_table_name: SS, from_table_name: SS, column_pairs: Vec<(SS, SS)>, relation_type: RelationType, disable_usage_checking: bool, ) -> Result<Self, String>
Constructs a composite (multi-column) foreign key relation from a list of
(from_column_name, to_column_name) pairs, one per column position.
Errors (rather than silently coercing) when fewer than two pairs are given -
a single-pair “composite” relation should be constructed via Relation::new instead.
pub fn to_table_name(&self) -> &str
Sourcepub fn to_column_name(&self) -> &str
pub fn to_column_name(&self) -> &str
First column pair’s target-table column. For a composite relation, prefer
Relation::column_pairs to see every mapped column.
pub fn from_table_name(&self) -> &str
Sourcepub fn from_column_name(&self) -> &str
pub fn from_column_name(&self) -> &str
First column pair’s local column. For a composite relation, prefer
Relation::column_pairs to see every mapped column.
Sourcepub fn column_pairs(&self) -> &[(String, String)]
pub fn column_pairs(&self) -> &[(String, String)]
All (from_column_name, to_column_name) pairs, in declared order.
pub fn is_composite(&self) -> bool
pub fn relation_type(&self) -> RelationType
pub fn disable_usage_checking(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Relation
impl RefUnwindSafe for Relation
impl Send for Relation
impl Sync for Relation
impl Unpin for Relation
impl UnsafeUnpin for Relation
impl UnwindSafe for Relation
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