pub struct SnowflakeGenerator { /* private fields */ }
Expand description
Generating Snowflake
Recommended keep this generator single-instance for one instance’s SID generation.
§Thread safety
You can use ::std::sync::Arc
sharing ownership between thread.
Implementations§
Source§impl SnowflakeGenerator
impl SnowflakeGenerator
pub fn with_cfg(cfg: SnowflakeConfiguration) -> Self
Sourcepub fn assign_sync<T>(&self, provider: &T) -> Snowflake
pub fn assign_sync<T>(&self, provider: &T) -> Snowflake
Assign a new Snowflake
but in synchronous way.
Trait Implementations§
Source§impl Debug for SnowflakeGenerator
impl Debug for SnowflakeGenerator
Source§impl Default for SnowflakeGenerator
impl Default for SnowflakeGenerator
Source§fn default() -> SnowflakeGenerator
fn default() -> SnowflakeGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for SnowflakeGenerator
impl RefUnwindSafe for SnowflakeGenerator
impl Send for SnowflakeGenerator
impl Sync for SnowflakeGenerator
impl Unpin for SnowflakeGenerator
impl UnwindSafe for SnowflakeGenerator
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