pub struct Batch<'a, K, V, D>{ /* private fields */ }Expand description
A batch of changes which may be written to an underlying store with Batchable::write_batch. Writes and deletes to a batch are not applied to the store until the batch is written but will be reflected in reads from the batch.
Implementations§
Trait Implementations§
Source§impl<'a, K, V, D> IntoIterator for Batch<'a, K, V, D>
impl<'a, K, V, D> IntoIterator for Batch<'a, K, V, D>
Source§impl<'a, K, V, D> Updatable for Batch<'a, K, V, D>
impl<'a, K, V, D> Updatable for Batch<'a, K, V, D>
Source§async fn update(&mut self, key: K, value: V) -> Result<(), Error>
async fn update(&mut self, key: K, value: V) -> Result<(), Error>
Updates the value of key to value in the batch.
Source§fn create<'a>(
&'a mut self,
key: Self::Key,
value: Self::Value,
) -> impl Future<Output = Result<bool, Self::Error>> + Send + use<'a, Self>where
Self: Send,
fn create<'a>(
&'a mut self,
key: Self::Key,
value: Self::Value,
) -> impl Future<Output = Result<bool, Self::Error>> + Send + use<'a, Self>where
Self: Send,
Creates a new key-value pair in the db. Returns true if the key was created, false if it
already existed. The key is not modified if it already existed.
Auto Trait Implementations§
impl<'a, K, V, D> Freeze for Batch<'a, K, V, D>
impl<'a, K, V, D> RefUnwindSafe for Batch<'a, K, V, D>
impl<'a, K, V, D> Send for Batch<'a, K, V, D>
impl<'a, K, V, D> Sync for Batch<'a, K, V, D>
impl<'a, K, V, D> Unpin for Batch<'a, K, V, D>
impl<'a, K, V, D> UnwindSafe for Batch<'a, K, V, D>
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more