Struct cassandra_cpp::UuidGen
source · pub struct UuidGen(_);
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);