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>
impl<Data> Commit<Data>
sourcepub fn immediately(data: Data) -> Self
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.
sourcepub fn default(data: Data) -> Self
pub fn default(data: Data) -> Self
Persist the data, using the default persistence policy for the service.
sourcepub fn within(data: Data, duration: Duration) -> Self
pub fn within(data: Data, duration: Duration) -> Self
Ensure that the data is persisted within a given duration.
sourcepub unsafe fn noop(data: Data) -> Self
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> 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