pub struct RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,{ /* private fields */ }
Expand description
Defines a helper to build a relation
Implementationsยง
Sourceยงimpl<E, R> RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
impl<E, R> RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
Sourcepub fn from<T>(self, identifier: T) -> Selfwhere
T: IdentityOf<E>,
pub fn from<T>(self, identifier: T) -> Selfwhere
T: IdentityOf<E>,
Build a relationship from an Entity
Sourcepub fn to<T>(self, identifier: T) -> Selfwhere
T: IdentityOf<R>,
pub fn to<T>(self, identifier: T) -> Selfwhere
T: IdentityOf<R>,
Build a relationship to an Entity
Sourcepub fn on_delete(self, action: ForeignKeyAction) -> Self
pub fn on_delete(self, action: ForeignKeyAction) -> Self
An operation to perform on a foreign key when a delete operation occurs
Sourcepub fn on_update(self, action: ForeignKeyAction) -> Self
pub fn on_update(self, action: ForeignKeyAction) -> Self
An operation to perform on a foreign key when an update operation occurs
Sourcepub fn on_condition<F>(self, f: F) -> Self
pub fn on_condition<F>(self, f: F) -> Self
Set custom join ON condition.
This method takes a closure with parameters denoting the left-hand side and right-hand side table in the join expression.
Sourcepub fn condition_type(self, condition_type: ConditionType) -> Self
pub fn condition_type(self, condition_type: ConditionType) -> Self
Set the condition type of join on expression
Trait Implementationsยง
Sourceยงimpl<E, R> Debug for RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
impl<E, R> Debug for RelationBuilder<E, R>where
E: EntityTrait,
R: EntityTrait,
Sourceยงimpl<E, R> From<RelationBuilder<E, R>> for RelationDefwhere
E: EntityTrait,
R: EntityTrait,
impl<E, R> From<RelationBuilder<E, R>> for RelationDefwhere
E: EntityTrait,
R: EntityTrait,
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> !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
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