Skip to main content

SetScope

Trait SetScope 

Source
pub trait SetScope: Send {
    // Required methods
    fn commit(self: Box<Self>) -> CommitFuture;
    fn rollback(self: Box<Self>) -> RollbackFuture;
}
Expand description

An open isolation (and, for SetMode::Atomic, transaction) scope over one Foo/set method call, from ConditionalBackend::begin_set.

The dispatcher ends it with exactly one of commit or rollback. Dropping a scope without either MUST roll it back: the dispatcher drops it when the method’s task panics or is cancelled.

Required Methods§

Source

fn commit(self: Box<Self>) -> CommitFuture

Make the scope’s writes visible and release it.

For an atomic scope, check the cross-object constraints (uniqueness, cycles, single default, children on destroy, quotas) against the final state; on a violation roll back and return CommitError::Rejected. Run deferred external effects (mail send, federation, push StateChange) only once committed.

Source

fn rollback(self: Box<Self>) -> RollbackFuture

Discard the scope’s writes and release it. The state string and change log are as before the scope opened (§4.2).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§