pub struct ManyToManyRef<'a, Owner, Related> { /* private fields */ }Expand description
Связь «многие ко многим» через pivot-таблицу.
Implementations§
Source§impl<'a, Owner, Related> ManyToManyRef<'a, Owner, Related>
impl<'a, Owner, Related> ManyToManyRef<'a, Owner, Related>
pub fn new( owner_id: i64, pivot_table: &'static str, owner_fk: &'static str, related_fk: &'static str, ) -> Self
pub async fn load(self, pool: &PgPool) -> OrmResult<Vec<Related>>
pub async fn attach(self, related_id: i64, pool: &PgPool) -> OrmResult<()>
pub async fn attach_many( self, related_ids: &[i64], pool: &PgPool, ) -> OrmResult<()>
pub async fn detach(self, related_id: i64, pool: &PgPool) -> OrmResult<()>
pub async fn detach_all(self, pool: &PgPool) -> OrmResult<()>
pub async fn sync(self, related_ids: &[i64], pool: &PgPool) -> OrmResult<()>
Auto Trait Implementations§
impl<'a, Owner, Related> Freeze for ManyToManyRef<'a, Owner, Related>
impl<'a, Owner, Related> RefUnwindSafe for ManyToManyRef<'a, Owner, Related>where
Related: RefUnwindSafe,
Owner: RefUnwindSafe,
impl<'a, Owner, Related> Send for ManyToManyRef<'a, Owner, Related>
impl<'a, Owner, Related> Sync for ManyToManyRef<'a, Owner, Related>
impl<'a, Owner, Related> Unpin for ManyToManyRef<'a, Owner, Related>where
Related: Unpin,
impl<'a, Owner, Related> UnsafeUnpin for ManyToManyRef<'a, Owner, Related>
impl<'a, Owner, Related> UnwindSafe for ManyToManyRef<'a, Owner, Related>where
Related: UnwindSafe,
Owner: RefUnwindSafe,
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