pub struct BatchPolicy {
    pub base_policy: BasePolicy,
    pub concurrency: Concurrency,
    pub allow_inline: bool,
    pub send_set_name: bool,
    pub filter_expression: Option<FilterExpression>,
}
Expand description

BatchPolicy encapsulates parameters for all batch operations.

Fields§

§base_policy: BasePolicy

Base policy instance

§concurrency: Concurrency

Concurrency mode for batch requests: Sequential or Parallel (with optional max. no of parallel threads).

§allow_inline: bool

Allow batch to be processed immediately in the server’s receiving thread when the server deems it to be appropriate. If false, the batch will always be processed in separate transaction threads.

For batch exists or batch reads of smaller sized records (<= 1K per record), inline processing will be significantly faster on “in memory” namespaces. The server disables inline processing on disk based namespaces regardless of this policy field.

Inline processing can introduce the possibility of unfairness because the server can process the entire batch before moving onto the next command.

Default: true

§send_set_name: bool

Send set name field to server for every key in the batch. This is only necessary when authentication is enabled and security roles are defined on a per-set basis.

Default: false

§filter_expression: Option<FilterExpression>

Optional Filter Expression

Implementations§

source§

impl BatchPolicy

source

pub fn new() -> Self

Create a new batch policy instance.

source

pub const fn filter_expression(&self) -> &Option<FilterExpression>

Get the current Filter Expression

Trait Implementations§

source§

impl Clone for BatchPolicy

source§

fn clone(&self) -> BatchPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BatchPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BatchPolicy

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Policy for Twhere T: PolicyLike,

source§

fn priority(&self) -> &Priority

Transaction priority.
source§

fn consistency_level(&self) -> &ConsistencyLevel

How replicas should be consulted in read operations to provide the desired consistency guarantee.
source§

fn deadline(&self) -> Option<Instant>

source§

fn timeout(&self) -> Option<Duration>

Total transaction timeout for both client and server. The timeout is tracked on the client and also sent to the server along with the transaction in the wire protocol. The client will most likely timeout first, but the server has the capability to timeout the transaction as well. Read more
source§

fn max_retries(&self) -> Option<usize>

Maximum number of retries before aborting the current transaction. A retry may be attempted when there is a network error. If max_retries is exceeded, the abort will occur even if the timeout has not yet been exceeded.
source§

fn sleep_between_retries(&self) -> Option<Duration>

Time to sleep between retries. Set to zero to skip sleep. Default: 500ms.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V