[−][src]Struct ulid_rs::Ulid
Ulid
Implementations
impl Ulid
[src]
pub fn new<F>(timestamp: u64, rng: F) -> Ulid where
F: Fn() -> u8,
[src]
F: Fn() -> u8,
creates new Ulid from a timestamp and a custom rng
pub fn encode_time(&mut self, timestamp: u64)
[src]
encodes time in the first 6 words
pub fn encode_entropy<F>(&mut self, rng: F) where
F: Fn() -> u8,
[src]
F: Fn() -> u8,
encodes entropy in the last 10 words
pub fn marshal(&self) -> [u8; 26]
[src]
create a string representation of the stored ULID
https://github.com/suyash/val/blob/master/ulid_uint128.hh#L253
pub fn unmarshal<S>(s: S) -> Result<Ulid, UlidError> where
S: AsRef<[u8]>,
[src]
S: AsRef<[u8]>,
unmarshals a string-like into a ULID
pub fn timestamp(&self) -> u64
[src]
return the timestamp associated with the Ulid
Trait Implementations
impl Debug for Ulid
[src]
impl From<[u8; 16]> for Ulid
[src]
impl<'a> Into<&'a [u8]> for &'a Ulid
[src]
impl Into<[u8; 16]> for Ulid
[src]
impl Into<Vec<u8>> for Ulid
[src]
impl PartialEq<Ulid> for Ulid
[src]
impl PartialOrd<Ulid> for Ulid
[src]
fn partial_cmp(&self, other: &Ulid) -> Option<Ordering>
[src]
fn lt(&self, other: &Ulid) -> bool
[src]
fn le(&self, other: &Ulid) -> bool
[src]
fn gt(&self, other: &Ulid) -> bool
[src]
fn ge(&self, other: &Ulid) -> bool
[src]
impl StructuralPartialEq for Ulid
[src]
impl ToString for Ulid
[src]
impl<'_> TryFrom<&'_ [u8]> for Ulid
[src]
type Error = TryFromSliceError
The type returned in the event of a conversion error.
fn try_from(f: &[u8]) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ str> for Ulid
[src]
type Error = UlidError
The type returned in the event of a conversion error.
fn try_from(s: &str) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for Ulid
[src]
type Error = UlidError
The type returned in the event of a conversion error.
fn try_from(s: String) -> Result<Self, Self::Error>
[src]
impl TryInto<String> for Ulid
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ulid
impl Send for Ulid
impl Sync for Ulid
impl Unpin for Ulid
impl UnwindSafe for Ulid
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,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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>,