Skip to main content

WriteGuard

Struct WriteGuard 

Source
pub struct WriteGuard<S: WriteStore> { /* private fields */ }

Implementations§

Source§

impl<S: WriteStore> WriteGuard<S>

Source

pub fn new(store: S) -> Self

Source

pub fn with_defaults( store: S, lease_ms: i64, ttl_ms: i64, ) -> Result<Self, WriteSafetyError>

Source

pub fn with_defaults_and_retention( store: S, lease_ms: i64, ttl_ms: i64, spent_key_retention_ms: i64, ) -> Result<Self, WriteSafetyError>

Source

pub fn execute<H, E>( &self, req: ExecuteRequest<'_>, handler: H, ) -> Result<WriteOutcome, E>

Source

pub fn execute_with_preview<H, P, E>( &self, req: ExecuteRequest<'_>, preview: P, handler: H, ) -> Result<WriteOutcome, E>

Source

pub fn execute_with_pre_effect<H, E>( &self, req: ExecuteRequest<'_>, handler: H, ) -> Result<WriteOutcome, E>

Run a handler that can explicitly report a failure before attempting the write.

Source

pub fn execute_with_preview_and_pre_effect<H, P, E>( &self, req: ExecuteRequest<'_>, preview: P, handler: H, ) -> Result<WriteOutcome, E>

Run a preview or a handler that can explicitly report a failure before attempting the write.

Auto Trait Implementations§

§

impl<S> Forget for WriteGuard<S>

§

impl<S> Freeze for WriteGuard<S>
where S: Freeze,

§

impl<S> Move for WriteGuard<S>

§

impl<S> RefUnwindSafe for WriteGuard<S>
where S: RefUnwindSafe,

§

impl<S> Send for WriteGuard<S>

§

impl<S> Sync for WriteGuard<S>

§

impl<S> Unpin for WriteGuard<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for WriteGuard<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for WriteGuard<S>
where S: 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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.