pub struct TransactionRelationManager<'t, S: Schema, M: RelationModel<Schema = S>> { /* private fields */ }Expand description
Schema-bound, model-branded exact relation manager borrowing one open client write transaction. Operations reuse the shared open context and never commit, roll back, or close it; errors are returned with the transaction left open for the caller to decide.
Implementations§
Source§impl<S, M> TransactionRelationManager<'_, S, M>
impl<S, M> TransactionRelationManager<'_, S, M>
Sourcepub async fn insert(&self, input: M::Create) -> Result<M>
pub async fn insert(&self, input: M::Create) -> Result<M>
Inserts one exact relation with its complete active role players in the open transaction and returns its complete freshly hydrated model without committing.
Sourcepub async fn put(&self, input: M::Create) -> Result<M>
pub async fn put(&self, input: M::Create) -> Result<M>
Applies the exact key-or-insert put rule in the open transaction, including complete replacement of non-key ownership and active role players for an existing exact row, without committing.
Sourcepub async fn insert_many(&self, inputs: Vec<M::Create>) -> Result<Vec<M>>
pub async fn insert_many(&self, inputs: Vec<M::Create>) -> Result<Vec<M>>
Inserts each item in input order in the open transaction, returning complete freshly hydrated models or one error, without committing. A successor-runtime failure after mutation dispatch makes the transaction rollback-only; a pre-dispatch failure leaves it active.
Sourcepub async fn put_many(&self, inputs: Vec<M::Create>) -> Result<Vec<M>>
pub async fn put_many(&self, inputs: Vec<M::Create>) -> Result<Vec<M>>
Applies the per-item put rule in input order in the open transaction, returning complete freshly hydrated models or one error, without committing. A successor-runtime failure after mutation dispatch makes the transaction rollback-only; a pre-dispatch failure leaves it active.
Sourcepub async fn update(&self, iid: &str, input: M::Create) -> Result<M>
pub async fn update(&self, iid: &str, input: M::Create) -> Result<M>
Completely replaces non-key ownership and the complete effective
active-role player set on the exact relation at canonical iid in the
open transaction, preserving that IID, without committing.
Sourcepub async fn delete(&self, iid: &str) -> Result<()>
pub async fn delete(&self, iid: &str) -> Result<()>
Deletes only the exact relation at canonical iid in the open
transaction, without committing.
Sourcepub async fn update_many(
&self,
inputs: Vec<(String, M::Create)>,
) -> Result<Vec<M>>
pub async fn update_many( &self, inputs: Vec<(String, M::Create)>, ) -> Result<Vec<M>>
Replaces each exact relation identified by its canonical IID in input order without committing. Successor-runtime failures after mutation dispatch make the transaction rollback-only.
Sourcepub async fn delete_many(&self, iids: &[String]) -> Result<()>
pub async fn delete_many(&self, iids: &[String]) -> Result<()>
Deletes every exact relation at the supplied canonical IIDs without committing. Successor-runtime failures after mutation dispatch make the transaction rollback-only.
Sourcepub async fn get_by_iid(&self, iid: &str) -> Result<Option<M>>
pub async fn get_by_iid(&self, iid: &str) -> Result<Option<M>>
Reads one exact coalesced relation by canonical IID through the open transaction, observing this transaction’s uncommitted writes.
Trait Implementations§
Source§impl<'t, S: Schema, M: RelationModel<Schema = S>> Clone for TransactionRelationManager<'t, S, M>
impl<'t, S: Schema, M: RelationModel<Schema = S>> Clone for TransactionRelationManager<'t, S, M>
impl<'t, S: Schema, M: RelationModel<Schema = S>> Copy for TransactionRelationManager<'t, S, M>
Auto Trait Implementations§
impl<'t, S, M> !RefUnwindSafe for TransactionRelationManager<'t, S, M>
impl<'t, S, M> !UnwindSafe for TransactionRelationManager<'t, S, M>
impl<'t, S, M> Freeze for TransactionRelationManager<'t, S, M>
impl<'t, S, M> Send for TransactionRelationManager<'t, S, M>
impl<'t, S, M> Sync for TransactionRelationManager<'t, S, M>
impl<'t, S, M> Unpin for TransactionRelationManager<'t, S, M>
impl<'t, S, M> UnsafeUnpin for TransactionRelationManager<'t, S, M>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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