pub struct Batch<T = Bound>(/* private fields */);
Expand description
A group of statements that are executed as a single batch. Note: Batches are not supported by the binary protocol version 1.
Implementations§
Source§impl<T> Batch<T>
impl<T> Batch<T>
Sourcepub async fn execute(self) -> Result<CassResult>
pub async fn execute(self) -> Result<CassResult>
Executes this batch.
Sourcepub fn set_consistency(&mut self, consistency: Consistency) -> Result<&mut Self>
pub fn set_consistency(&mut self, consistency: Consistency) -> Result<&mut Self>
Sets the batch’s consistency level
Sourcepub fn set_serial_consistency(
&mut self,
consistency: Consistency,
) -> Result<&mut Self>
pub fn set_serial_consistency( &mut self, consistency: Consistency, ) -> Result<&mut Self>
Sets the batch’s serial consistency level.
Default: Not set
Sourcepub fn set_timestamp(&mut self, timestamp: i64) -> Result<&mut Self>
pub fn set_timestamp(&mut self, timestamp: i64) -> Result<&mut Self>
Sets the batch’s timestamp.
Sourcepub fn set_retry_policy(
&mut self,
retry_policy: RetryPolicy,
) -> Result<&mut Self>
pub fn set_retry_policy( &mut self, retry_policy: RetryPolicy, ) -> Result<&mut Self>
Sets the batch’s retry policy.
Sourcepub fn set_custom_payload(
&mut self,
custom_payload: CustomPayload,
) -> Result<&mut Self>
pub fn set_custom_payload( &mut self, custom_payload: CustomPayload, ) -> Result<&mut Self>
Sets the batch’s custom payload.
Sourcepub fn add_statement(&mut self, statement: Statement<T>) -> Result<&mut Self>
pub fn add_statement(&mut self, statement: Statement<T>) -> Result<&mut Self>
Adds a statement to a batch.
Sourcepub fn set_is_idempotent(&mut self, is_idempotent: bool) -> Result<&mut Self>
pub fn set_is_idempotent(&mut self, is_idempotent: bool) -> Result<&mut Self>
Sets whether the statements in a batch are idempotent. Idempotent batches are able to be automatically retried after timeouts/errors and can be speculatively executed.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Batch<T>
impl<T> RefUnwindSafe for Batch<T>where
T: RefUnwindSafe,
impl<T> Send for Batch<T>where
T: Send,
impl<T = Bound> !Sync for Batch<T>
impl<T> Unpin for Batch<T>
impl<T> UnwindSafe for Batch<T>where
T: RefUnwindSafe,
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