pub struct Operation { /* private fields */ }Expand description
One write inside a Transaction.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn put(
collection: impl Into<String>,
id: impl Into<String>,
value: Value,
) -> Self
pub fn put( collection: impl Into<String>, id: impl Into<String>, value: Value, ) -> Self
Write value (a JSON object) as the record, whether or not it exists.
Sourcepub fn create(
collection: impl Into<String>,
id: impl Into<String>,
value: Value,
) -> Self
pub fn create( collection: impl Into<String>, id: impl Into<String>, value: Value, ) -> Self
Create the record; the whole transaction is refused if it already exists. The authority
assigns the created document __version 1.
Sourcepub fn expect_version(self, version: u64) -> Self
pub fn expect_version(self, version: u64) -> Self
Commit only if the record’s __version is still version.
Sourcepub fn expect_epoch(self, epoch: u64) -> Self
pub fn expect_epoch(self, epoch: u64) -> Self
Commit only if the record’s authority epoch is still epoch.
Sourcepub fn expect_lease(self, lease_id: impl Into<String>) -> Self
pub fn expect_lease(self, lease_id: impl Into<String>) -> Self
Commit only while lease_id is an unexpired lease on the record.
Trait Implementations§
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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