pub enum Precondition {
IfAbsent,
IfMatch(String),
}Expand description
Precondition for a conditional write (ObjectStore::put_if).
Maps onto S3/R2 conditional-write headers so a caller can perform a linearizable compare-and-swap on a single object — e.g. the global tenant→cell pointer in W243 — without any external lock or consensus.
Variants§
IfAbsent
Write only if no object exists at the key yet (create-only).
Wire form: If-None-Match: *. Fails with Error::PreconditionFailed
if any object already exists at the key.
IfMatch(String)
Write only if the current object’s ETag equals this value (optimistic
concurrency). Wire form: If-Match: <etag>. Fails with
Error::PreconditionFailed if the stored ETag differs or the key is
absent. The comparand is an ETag returned by a prior ObjectStore::put_if
or ObjectStore::etag.
Trait Implementations§
Source§impl Clone for Precondition
impl Clone for Precondition
Source§fn clone(&self) -> Precondition
fn clone(&self) -> Precondition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Precondition
impl RefUnwindSafe for Precondition
impl Send for Precondition
impl Sync for Precondition
impl Unpin for Precondition
impl UnsafeUnpin for Precondition
impl UnwindSafe for Precondition
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