pub struct WithRelation<M: Model + ModelExt + RelationLoader> { /* private fields */ }Expand description
关系预加载构造器
Implementations§
Source§impl<M: Model + ModelExt + RelationLoader> WithRelation<M>
impl<M: Model + ModelExt + RelationLoader> WithRelation<M>
Sourcepub async fn load<C>(self, conn: &mut C) -> Result<M, RelationError>where
C: Connection + ?Sized,
pub async fn load<C>(self, conn: &mut C) -> Result<M, RelationError>where
C: Connection + ?Sized,
加载所有指定关系并返回填充后的模型
加载结果通过 set_relation_data 写回模型
Auto Trait Implementations§
impl<M> Freeze for WithRelation<M>where
M: Freeze,
impl<M> RefUnwindSafe for WithRelation<M>where
M: RefUnwindSafe,
impl<M> Send for WithRelation<M>
impl<M> Sync for WithRelation<M>
impl<M> Unpin for WithRelation<M>where
M: Unpin,
impl<M> UnsafeUnpin for WithRelation<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for WithRelation<M>where
M: UnwindSafe,
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