pub enum RelationType {
OneToMany(String),
RequiredReference(String),
OptionalReference(String),
ManyToMany(String),
}Variants§
OneToMany(String)
One-to-many: [Post] means this model has many Posts
RequiredReference(String)
Required reference: *User means this model must reference a User
OptionalReference(String)
Optional reference: ?User means this model optionally references a User
ManyToMany(String)
Many-to-many: detected from bidirectional OneToMany fields
Implementations§
Source§impl RelationType
impl RelationType
pub fn target_model(&self) -> &str
pub fn is_one_to_many(&self) -> bool
pub fn is_reference(&self) -> bool
pub fn is_many_to_many(&self) -> bool
Trait Implementations§
Source§impl Clone for RelationType
impl Clone for RelationType
Source§fn clone(&self) -> RelationType
fn clone(&self) -> RelationType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RelationType
impl Debug for RelationType
Source§impl PartialEq for RelationType
impl PartialEq for RelationType
impl StructuralPartialEq for RelationType
Auto Trait Implementations§
impl Freeze for RelationType
impl RefUnwindSafe for RelationType
impl Send for RelationType
impl Sync for RelationType
impl Unpin for RelationType
impl UnsafeUnpin for RelationType
impl UnwindSafe for RelationType
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