pub struct IdentityDef {
pub name: &'static str,
pub schema: Option<&'static str>,
pub type_: IdentityType,
pub increment: Option<&'static str>,
pub min_value: Option<&'static str>,
pub max_value: Option<&'static str>,
pub start_with: Option<&'static str>,
pub cache: Option<i32>,
pub cycle: bool,
}Expand description
Identity column configuration (const-friendly)
Fields§
§name: &'static strSequence name
schema: Option<&'static str>Schema name (optional)
type_: IdentityTypeIdentity type: always or by_default
increment: Option<&'static str>Increment value (as string)
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: Option<i32>Cache value (as i32)
cycle: boolCycle flag
Implementations§
Source§impl IdentityDef
impl IdentityDef
Sourcepub const fn new(name: &'static str, type_: IdentityType) -> Self
pub const fn new(name: &'static str, type_: IdentityType) -> Self
Create a new identity definition
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 into_identity(self) -> Identity
pub const fn into_identity(self) -> Identity
Convert to runtime type
Trait Implementations§
Source§impl Clone for IdentityDef
impl Clone for IdentityDef
Source§fn clone(&self) -> IdentityDef
fn clone(&self) -> IdentityDef
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 IdentityDef
impl Debug for IdentityDef
Source§impl Hash for IdentityDef
impl Hash for IdentityDef
Source§impl PartialEq for IdentityDef
impl PartialEq for IdentityDef
impl Copy for IdentityDef
impl Eq for IdentityDef
impl StructuralPartialEq for IdentityDef
Auto Trait Implementations§
impl Freeze for IdentityDef
impl RefUnwindSafe for IdentityDef
impl Send for IdentityDef
impl Sync for IdentityDef
impl Unpin for IdentityDef
impl UnwindSafe for IdentityDef
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