pub struct RelationBuilder<E: EntityTrait, R: EntityTrait> { /* private fields */ }Expand description
A builder for a RelationDef, returned by EntityTrait::belongs_to,
EntityTrait::has_one and EntityTrait::has_many.
Implementations§
Source§impl<E: EntityTrait, R: EntityTrait> RelationBuilder<E, R>
impl<E: EntityTrait, R: EntityTrait> RelationBuilder<E, R>
Sourcepub fn from<C: ColumnTrait>(self, column: C) -> Self
pub fn from<C: ColumnTrait>(self, column: C) -> Self
Adds a join column on E; call once per column of a composite key.
Sourcepub fn to<C: ColumnTrait>(self, column: C) -> Self
pub fn to<C: ColumnTrait>(self, column: C) -> Self
Adds a join column on R; call once per column of a composite key.
Sourcepub fn on_delete(self, action: ForeignKeyAction) -> Self
pub fn on_delete(self, action: ForeignKeyAction) -> Self
Sets the ON DELETE action of the generated foreign key.
Sourcepub fn on_update(self, action: ForeignKeyAction) -> Self
pub fn on_update(self, action: ForeignKeyAction) -> Self
Sets the ON UPDATE action of the generated foreign key.
Trait Implementations§
Source§impl<E: Debug + EntityTrait, R: Debug + EntityTrait> Debug for RelationBuilder<E, R>
impl<E: Debug + EntityTrait, R: Debug + EntityTrait> Debug for RelationBuilder<E, R>
Source§impl<E: EntityTrait, R: EntityTrait> From<RelationBuilder<E, R>> for RelationDef
impl<E: EntityTrait, R: EntityTrait> From<RelationBuilder<E, R>> for RelationDef
Source§fn from(b: RelationBuilder<E, R>) -> Self
fn from(b: RelationBuilder<E, R>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<E, R> Freeze for RelationBuilder<E, R>
impl<E, R> RefUnwindSafe for RelationBuilder<E, R>
impl<E, R> Send for RelationBuilder<E, R>
impl<E, R> Sync for RelationBuilder<E, R>
impl<E, R> Unpin for RelationBuilder<E, R>
impl<E, R> UnsafeUnpin for RelationBuilder<E, R>
impl<E, R> UnwindSafe for RelationBuilder<E, R>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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