Struct idgenerator::generator::CoreIdGenerator
source · [−]pub struct CoreIdGenerator { /* private fields */ }
Expand description
Wrapper of the snowflake algorithm worker. Provide public interfaces to initialize a generator, set options, get options and get a unique id.
Implementations
sourceimpl CoreIdGenerator
impl CoreIdGenerator
pub fn init(&mut self, options: IdGeneratorOptions) -> Result<(), OptionError>
pub fn get_options(&self) -> IdGeneratorOptions
pub fn set_options(
&mut self,
options: IdGeneratorOptions
) -> Result<(), OptionError>
pub fn next_id(&mut self) -> i64
Trait Implementations
sourceimpl Debug for CoreIdGenerator
impl Debug for CoreIdGenerator
sourceimpl Default for CoreIdGenerator
impl Default for CoreIdGenerator
sourcefn default() -> CoreIdGenerator
fn default() -> CoreIdGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for CoreIdGenerator
impl Send for CoreIdGenerator
impl Sync for CoreIdGenerator
impl Unpin for CoreIdGenerator
impl UnwindSafe for CoreIdGenerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more