Struct discord_cassandra_cpp::TimestampGen
source · [−]pub struct TimestampGen(_);
Expand description
Generators of client-side, microsecond-precision timestamps. Note: This generator is thread-safe and can be shared by multiple sessions.
Implementations
sourceimpl TimestampGen
impl TimestampGen
sourcepub fn time_from_epoch(epoch_seconds: Duration) -> Time
pub fn time_from_epoch(epoch_seconds: Duration) -> Time
Converts a unix timestamp (in seconds) to the Cassandra “time” type. The “time” type represents the number of nanoseconds since midnight (range 0 to 86399999999999).
sourcepub fn gen_monotonic_new() -> Self
pub fn gen_monotonic_new() -> Self
Creates a new monotonically increasing timestamp generator. This generates microsecond timestamps with the sub-millisecond part generated using a counter. The implementation guarantees that no more than 1000 timestamps will be generated for a given clock tick even if shared by multiple session objects. If that rate is exceeded then a warning is logged and timestamps stop incrementing until the next clock tick.
sourcepub fn gen_server_side_new() -> Self
pub fn gen_server_side_new() -> Self
Creates a new server-side timestamp generator. This generator allows Cassandra to assign timestamps server-side.
Note: This is the default timestamp generator.
Trait Implementations
sourceimpl Debug for TimestampGen
impl Debug for TimestampGen
sourceimpl Drop for TimestampGen
impl Drop for TimestampGen
impl Send for TimestampGen
impl Sync for TimestampGen
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more