pub struct WriteTransaction<'db, S: Schema> { /* private fields */ }Expand description
One client-owned open write transaction over a schema-bound database.
The wrapper is not cloneable and owns the sole retained engine context.
Manager handles borrow the wrapper, so Self::commit and
Self::rollback — which consume it — cannot run while a manager is
retained, and a second terminal operation is unrepresentable. Operations
never auto-commit: an operation error leaves terminal control with the
caller, and dropping an open wrapper releases the context without commit.
Under the successor runtime, a batch failure before mutation dispatch
leaves the transaction active, while a failure after dispatch makes it
rollback-only and Self::commit returns transaction_rollback_only.
Implementations§
Source§impl<'db, S: Schema> WriteTransaction<'db, S>
impl<'db, S: Schema> WriteTransaction<'db, S>
Sourcepub fn entities<M>(&self) -> TransactionEntityManager<'_, S, M>where
M: EntityModel<Schema = S>,
pub fn entities<M>(&self) -> TransactionEntityManager<'_, S, M>where
M: EntityModel<Schema = S>,
Create an exact entity manager borrowing this open transaction.
Sourcepub fn relations<M>(&self) -> TransactionRelationManager<'_, S, M>where
M: RelationModel<Schema = S>,
pub fn relations<M>(&self) -> TransactionRelationManager<'_, S, M>where
M: RelationModel<Schema = S>,
Create an exact relation manager borrowing this open transaction.
Trait Implementations§
Auto Trait Implementations§
impl<'db, S> !RefUnwindSafe for WriteTransaction<'db, S>
impl<'db, S> !UnwindSafe for WriteTransaction<'db, S>
impl<'db, S> Freeze for WriteTransaction<'db, S>
impl<'db, S> Send for WriteTransaction<'db, S>
impl<'db, S> Sync for WriteTransaction<'db, S>
impl<'db, S> Unpin for WriteTransaction<'db, S>
impl<'db, S> UnsafeUnpin for WriteTransaction<'db, S>where
&'db Database<S>: UnsafeUnpin,
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
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request