pub struct SequenceConfig {
pub cache_size: i32,
pub range_min: i64,
pub range_max: i64,
pub initial_value: i64,
pub allow_create: bool,
pub decrement: bool,
pub exclusive_create: bool,
pub wrap: bool,
}Expand description
Specifies the attributes of a sequence.
Fields§
§cache_size: i32Number of elements cached in the sequence handle (default 20).
default is 0 but the task specifies 20 as the noxu default for pre-fetching. A value of 0 disables caching (every get hits the DB).
range_min: i64Minimum value for the sequence (default i64::MIN).
range_max: i64Maximum value for the sequence (default i64::MAX).
initial_value: i64Initial value when the sequence is first created (default 0).
allow_create: boolCreate the sequence if it does not exist (default false).
decrement: boolThe sequence counts downward when true (default false — counts upward).
exclusive_create: boolFail if the sequence already exists (default false).
wrap: boolWrap around when the range limit is reached (default false).
Implementations§
Source§impl SequenceConfig
impl SequenceConfig
Sourcepub fn with_cache_size(self, cache_size: i32) -> Self
pub fn with_cache_size(self, cache_size: i32) -> Self
Sets the number of cached elements.
Sourcepub fn with_range(self, min: i64, max: i64) -> Self
pub fn with_range(self, min: i64, max: i64) -> Self
Sets the sequence range.
Sourcepub fn with_range_min(self, min: i64) -> Self
pub fn with_range_min(self, min: i64) -> Self
Sets the minimum value of the range.
Sourcepub fn with_range_max(self, max: i64) -> Self
pub fn with_range_max(self, max: i64) -> Self
Sets the maximum value of the range.
Sourcepub fn with_initial_value(self, initial_value: i64) -> Self
pub fn with_initial_value(self, initial_value: i64) -> Self
Sets the initial value (only effective on creation).
Sourcepub fn with_allow_create(self, allow_create: bool) -> Self
pub fn with_allow_create(self, allow_create: bool) -> Self
Configures whether the sequence is created if missing.
Sourcepub fn with_decrement(self, decrement: bool) -> Self
pub fn with_decrement(self, decrement: bool) -> Self
Configures whether the sequence decrements instead of incrementing.
Sourcepub fn with_exclusive_create(self, exclusive_create: bool) -> Self
pub fn with_exclusive_create(self, exclusive_create: bool) -> Self
Configures whether to fail when the sequence already exists.
Trait Implementations§
Source§impl Clone for SequenceConfig
impl Clone for SequenceConfig
Source§fn clone(&self) -> SequenceConfig
fn clone(&self) -> SequenceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more