[−][src]Struct lolid::Timestamp
Timestamp for use with v1
algorithm.
Implementations
impl Timestamp
[src]
pub const fn from_parts(ticks: u64, counter: u16) -> Self
[src]
Creates timestamp from raw parts, as per RFC4122.
ticks
is number of 100-nanoseconds intervals elapsed since 15 Oct 1582 00:00:00.00.counter
is value used to differentiate between timestamps generated to avoid collision in case of rapid generation.
pub const fn from_unix(time: Duration) -> Self
[src]
Creates instance from unix timestamp, namely it takes seconds and subsec_nanos.
Note it doesn't set counter, if needed it must be set manually
pub const fn set_counter(self, counter: u16) -> Self
[src]
Sets counter to further avoid chance of collision between timestamps.
Useful if clock is not guaranteed to be monotonically increasing. Otherwise there is no benefit in setting the counter.
pub const fn into_parts(self) -> (u64, u16)
[src]
Retrieves timestamp as raw parts
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,