Trait aerospike::policy::Policy

source ·
pub trait Policy {
    // Required methods
    fn priority(&self) -> &Priority;
    fn timeout(&self) -> Option<Duration>;
    fn max_retries(&self) -> Option<usize>;
    fn sleep_between_retries(&self) -> Option<Duration>;
    fn consistency_level(&self) -> &ConsistencyLevel;
}
Expand description

Trait implemented by most policy types; policies that implement this trait typically encompass an instance of BasePolicy.

Required Methods§

source

fn priority(&self) -> &Priority

Transaction priority.

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.

The timeout is also used as a socket timeout. Default: 0 (no timeout).

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

fn consistency_level(&self) -> &ConsistencyLevel

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

Implementors§

source§

impl Policy for BasePolicy

source§

impl<T> Policy for Twhere T: PolicyLike,