Struct cassandra_cpp::UuidGen
source · pub struct UuidGen(/* private fields */);
Expand description
A UUID generator object.
Instances of the UUID generator object are thread-safe to generate UUIDs.
Implementations§
source§impl UuidGen
impl UuidGen
sourcepub fn new_with_node(node: u64) -> UuidGen
pub fn new_with_node(node: u64) -> UuidGen
Creates a new UUID generator with custom node information. Note: This object is thread-safe. It is best practice to create and reuse a single object per application.
sourcepub fn gen_random(&self) -> Uuid
pub fn gen_random(&self) -> Uuid
Generates a new V4 (random) UUID
sourcepub fn gen_from_time(&self, timestamp: u64) -> Uuid
pub fn gen_from_time(&self, timestamp: u64) -> Uuid
Generates a V1 (time) UUID for the specified time.
§Examples
let generator = UuidGen::default();
let uuid = generator.gen_from_time(1457486866742u64);
Trait Implementations§
impl Send for UuidGen
impl Sync for UuidGen
Auto Trait Implementations§
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