pub struct SequenceDef {
pub schema: &'static str,
pub name: &'static str,
pub increment_by: Option<&'static str>,
pub min_value: Option<&'static str>,
pub max_value: Option<&'static str>,
pub start_with: Option<&'static str>,
pub cache_size: Option<i32>,
pub cycle: Option<bool>,
}Expand description
Const-friendly sequence definition for compile-time schema definitions.
Fields§
§schema: &'static strSchema name
name: &'static strSequence name
increment_by: Option<&'static str>Increment value (as string for const compatibility)
min_value: Option<&'static str>Minimum value (as string)
max_value: Option<&'static str>Maximum value (as string)
start_with: Option<&'static str>Start value (as string)
cache_size: Option<i32>Cache size
cycle: Option<bool>Cycle flag
Implementations§
Source§impl SequenceDef
impl SequenceDef
Sourcepub const fn new(schema: &'static str, name: &'static str) -> Self
pub const fn new(schema: &'static str, name: &'static str) -> Self
Create a new sequence definition
Sourcepub const fn increment_by(self, value: &'static str) -> Self
pub const fn increment_by(self, value: &'static str) -> Self
Set increment value
Sourcepub const fn start_with(self, value: &'static str) -> Self
pub const fn start_with(self, value: &'static str) -> Self
Set start value
Sourcepub const fn cache_size(self, value: i32) -> Self
pub const fn cache_size(self, value: i32) -> Self
Set cache size
Sourcepub const fn into_sequence(self) -> Sequence
pub const fn into_sequence(self) -> Sequence
Convert to runtime Sequence type
Trait Implementations§
Source§impl Clone for SequenceDef
impl Clone for SequenceDef
Source§fn clone(&self) -> SequenceDef
fn clone(&self) -> SequenceDef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SequenceDef
impl Debug for SequenceDef
Source§impl Default for SequenceDef
impl Default for SequenceDef
Source§impl From<SequenceDef> for Sequence
impl From<SequenceDef> for Sequence
Source§fn from(def: SequenceDef) -> Self
fn from(def: SequenceDef) -> Self
Converts to this type from the input type.
Source§impl Hash for SequenceDef
impl Hash for SequenceDef
Source§impl PartialEq for SequenceDef
impl PartialEq for SequenceDef
impl Copy for SequenceDef
impl Eq for SequenceDef
impl StructuralPartialEq for SequenceDef
Auto Trait Implementations§
impl Freeze for SequenceDef
impl RefUnwindSafe for SequenceDef
impl Send for SequenceDef
impl Sync for SequenceDef
impl Unpin for SequenceDef
impl UnwindSafe for SequenceDef
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