Struct thingvellir::Commit

source ·
pub struct Commit<Data>(/* private fields */);
Expand description

Specifies how the execute_mut should be committed to the upstream.

This allows you to control the durability of your data mutation.

Implementations§

source§

impl<Data> Commit<Data>

source

pub fn immediately(data: Data) -> Self

Persist the item immediately. The execution future will not resolve until your write has been been acknowledged by the upstream layer.

source

pub fn default(data: Data) -> Self

Persist the data, using the default persistence policy for the service.

source

pub fn within(data: Data, duration: Duration) -> Self

Ensure that the data is persisted within a given duration.

source

pub unsafe fn noop(data: Data) -> Self

The mutation resulted in a no-op. Do not try to persist the data in any way.

§Safety

This function is unsafe, as it’s up to you to make sure to only call this if and only if the data truly did not change. Since you’re getting a &mut to the data, this contract cannot be statically enforced. So, it’s up to you to use correctly.

Auto Trait Implementations§

§

impl<Data> Freeze for Commit<Data>
where Data: Freeze,

§

impl<Data> RefUnwindSafe for Commit<Data>
where Data: RefUnwindSafe,

§

impl<Data> Send for Commit<Data>
where Data: Send,

§

impl<Data> Sync for Commit<Data>
where Data: Sync,

§

impl<Data> Unpin for Commit<Data>
where Data: Unpin,

§

impl<Data> UnwindSafe for Commit<Data>
where Data: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V