[−][src]Struct no_proto::pointer::ulid::NP_ULID
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]
F: Fn(u8, u8) -> u8,
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]
pub fn clone(&self) -> NP_ULID
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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
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>,