pub struct PutBuilder { /* private fields */ }Expand description
A pending put, created with OxiaClient::put. Chain options and
.await it.
Implementations§
Source§impl PutBuilder
impl PutBuilder
Sourcepub fn expected_version_id(self, version_id: i64) -> Self
pub fn expected_version_id(self, version_id: i64) -> Self
Makes the put conditional: it succeeds only if the record’s current
version id matches (compare-and-swap). Fails with
OxiaError::UnexpectedVersionId otherwise.
Sourcepub fn expected_record_not_exists(self) -> Self
pub fn expected_record_not_exists(self) -> Self
Makes the put conditional on the record not existing yet. Fails with
OxiaError::UnexpectedVersionId if it does.
Sourcepub fn partition_key(self, partition_key: impl Into<String>) -> Self
pub fn partition_key(self, partition_key: impl Into<String>) -> Self
Routes (and co-locates) the record by partition_key instead of by its
own key. Records sharing a partition key always live on the same shard.
Sourcepub fn sequence_key_deltas(self, deltas: impl IntoIterator<Item = u64>) -> Self
pub fn sequence_key_deltas(self, deltas: impl IntoIterator<Item = u64>) -> Self
Turns the key into a server-generated sequential key: each delta is added to the current highest sequence and appended as a zero-padded suffix.
Requires partition_key; every delta must
be greater than zero; and it cannot be combined with
expected_version_id. Awaiting a put
that violates any of these fails with OxiaError::InvalidArgument.
Trait Implementations§
Source§impl Debug for PutBuilder
impl Debug for PutBuilder
Source§impl IntoFuture for PutBuilder
impl IntoFuture for PutBuilder
Source§type Output = Result<PutResult, OxiaError>
type Output = Result<PutResult, OxiaError>
Source§type IntoFuture = Pin<Box<dyn Future<Output = <PutBuilder as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <PutBuilder as IntoFuture>::Output> + Send>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl !Freeze for PutBuilder
impl !RefUnwindSafe for PutBuilder
impl !UnwindSafe for PutBuilder
impl Send for PutBuilder
impl Sync for PutBuilder
impl Unpin for PutBuilder
impl UnsafeUnpin for PutBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request