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§
Source§impl 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§
Source§impl Debug for CoreIdGenerator
impl Debug for CoreIdGenerator
Source§impl Default for CoreIdGenerator
impl Default for CoreIdGenerator
Source§fn default() -> CoreIdGenerator
fn default() -> CoreIdGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CoreIdGenerator
impl RefUnwindSafe for CoreIdGenerator
impl Send for CoreIdGenerator
impl Sync for CoreIdGenerator
impl Unpin for CoreIdGenerator
impl UnwindSafe for CoreIdGenerator
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