[][src]Struct no_proto::pointer::ulid::NP_ULID

#[repr(C)]pub struct NP_ULID { /* fields omitted */ }

Holds ULIDs which are good for time series keys.

Check out documentation here.

Implementations

impl NP_ULID[src]

pub fn generate(now_ms: u64, random_seed: u32) -> NP_ULID[src]

Creates a new ULID from the timestamp and provided seed.

The random seed is used to generate the ID, the same seed will always lead to the same random bytes so try to use something actually random for the seed.

The time should be passed in as the unix epoch in milliseconds.

pub fn generate_with_rand<F>(now_ms: u64, random_fn: F) -> NP_ULID where
    F: Fn(u8, u8) -> u8, 
[src]

Generates a ULID with the given time and a provided random number generator. This is the preferrable way to generate a ULID, if you can provide a better RNG function than the psudorandom one built into this library, you should.

pub fn get_time(&self) -> u64[src]

Get just the time component for this ULID

pub fn to_string(&self) -> String[src]

Generates a stringified version of this ULID with base32.

Trait Implementations

impl Clone for NP_ULID[src]

impl Debug for NP_ULID[src]

impl Default for NP_ULID[src]

impl Eq for NP_ULID[src]

impl<'_> NP_Scalar for &'_ NP_ULID[src]

impl PartialEq<NP_ULID> for NP_ULID[src]

impl StructuralEq for NP_ULID[src]

impl StructuralPartialEq for NP_ULID[src]

Auto Trait Implementations

impl Send for NP_ULID

impl Sync for NP_ULID

impl Unpin for NP_ULID

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.