pub struct StoreBatch<'a, S: Store> { /* private fields */ }Expand description
A synchronous batch bound to one mounted store. Dropping it discards its prepared changes.
Implementations§
Source§impl<S: Store> StoreBatch<'_, S>
impl<S: Store> StoreBatch<'_, S>
Sourcepub fn insert_input<I: InsertInput<Entity: Entity<Store = S>>>(
&mut self,
input: I,
) -> Result<I::Entity, Error>
pub fn insert_input<I: InsertInput<Entity: Entity<Store = S>>>( &mut self, input: I, ) -> Result<I::Entity, Error>
Queue an insertion using the entity’s generated input and return the prepared row.
§Errors
Propagates Batch::insert_input admission errors.
Sourcepub fn commit(self) -> Result<(), Error>
pub fn commit(self) -> Result<(), Error>
Apply the prepared changes through the owning store session.
§Errors
Propagates DatabaseSession::commit borrow and commit errors.
Sourcepub fn commit_returning<E: Entity<Store = S>>(
self,
key: impl Into<Id<E>>,
) -> Result<E, Error>
pub fn commit_returning<E: Entity<Store = S>>( self, key: impl Into<Id<E>>, ) -> Result<E, Error>
Commit all queued changes and return one inserted or replaced row from this store.
§Errors
Propagates DatabaseSession::commit_returning borrow, selection and commit errors.
Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for StoreBatch<'a, S>
impl<'a, S> !Send for StoreBatch<'a, S>
impl<'a, S> !Sync for StoreBatch<'a, S>
impl<'a, S> !UnwindSafe for StoreBatch<'a, S>
impl<'a, S> Forget for StoreBatch<'a, S>
impl<'a, S> Freeze for StoreBatch<'a, S>
impl<'a, S> Move for StoreBatch<'a, S>
impl<'a, S> Unpin for StoreBatch<'a, S>
impl<'a, S> UnsafeUnpin for StoreBatch<'a, S>
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