pub struct MutationId { /* private fields */ }Expand description
A GUID the cluster deduplicates a repeated mutation by.
The client generates one for every mutating command it may have to repeat,
so retries never apply a change twice. Passing your own is for a stronger
guarantee than one process can give itself: persist the ID, and replaying
the command after a crash returns the original result rather than starting
a second operation. See
Client::start_operation_with.
A replay must say that it is one. The ID carries that flag, because the
cluster does not infer it: sending a known ID again without it is refused
with Duplicate request is not marked as "retry" rather than deduplicated.
use ytsaurus_client::MutationId;
let first = MutationId::new(); // the original request
let again = first.as_retry(); // the same mutation, sent again
assert_eq!(first.as_str(), again.as_str());
assert!(!first.is_retry() && again.is_retry());Implementations§
Source§impl MutationId
impl MutationId
Trait Implementations§
Source§impl Clone for MutationId
impl Clone for MutationId
Source§fn clone(&self) -> MutationId
fn clone(&self) -> MutationId
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 moreSource§impl Debug for MutationId
impl Debug for MutationId
Source§impl Default for MutationId
impl Default for MutationId
Source§impl Display for MutationId
impl Display for MutationId
impl Eq for MutationId
Source§impl PartialEq for MutationId
impl PartialEq for MutationId
impl StructuralPartialEq for MutationId
Auto Trait Implementations§
impl Freeze for MutationId
impl RefUnwindSafe for MutationId
impl Send for MutationId
impl Sync for MutationId
impl Unpin for MutationId
impl UnsafeUnpin for MutationId
impl UnwindSafe for MutationId
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