pub struct Ulid(/* private fields */);Expand description
A 128-bit ULID with exact 16-byte storage and canonical uppercase text.
Use Self::generate_prand for synchronous issuance on the IC or a native host.
Construct supplied identifiers with Self::from_bytes, Self::from_u128 or parsing.
Implementations§
Source§impl Ulid
impl Ulid
Sourcepub fn generate_prand() -> Self
pub fn generate_prand() -> Self
Issue synchronously from the current thread’s predictable stream.
§Panics
Panics on suffix exhaustion or if the native OS cannot seed the thread.
Sourcepub async fn generator() -> Result<SeededUlidGenerator, UlidEntropyError>
pub async fn generator() -> Result<SeededUlidGenerator, UlidEntropyError>
Start an owned generator with fresh entropy from the IC or native OS. Later issuance is synchronous.
§Errors
Returns the entropy request or framing error.
Sourcepub fn generator_prand() -> SeededUlidGenerator
pub fn generator_prand() -> SeededUlidGenerator
Start an independent predictable stream under the current canister or native thread identity.
§Panics
Panics on stream counter exhaustion or if the native OS cannot seed the thread.
Trait Implementations§
impl Copy for Ulid
impl Eq for Ulid
Source§impl From<Ulid> for IndexValue<'_>
impl From<Ulid> for IndexValue<'_>
Source§impl Ord for Ulid
impl Ord for Ulid
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Ulid
impl PartialOrd for Ulid
impl PrimaryKey for Ulid
impl StructuralPartialEq for Ulid
Auto Trait Implementations§
impl Forget for Ulid
impl Freeze for Ulid
impl Move for Ulid
impl RefUnwindSafe for Ulid
impl Send for Ulid
impl Sync for Ulid
impl Unpin for Ulid
impl UnsafeUnpin for Ulid
impl UnwindSafe for Ulid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more