pub struct UlidIdentifier(/* private fields */);Expand description
ULID-based identifier implementation
Implementations§
Source§impl UlidIdentifier
impl UlidIdentifier
Sourcepub fn with_timestamp(timestamp_ms: u64) -> Self
pub fn with_timestamp(timestamp_ms: u64) -> Self
Create a ULID with a specific timestamp
Sourcepub fn get_timestamp_ms(&self) -> u64
pub fn get_timestamp_ms(&self) -> u64
Get the timestamp in milliseconds
Sourcepub fn monotonic_from(previous: Option<&Self>) -> Self
pub fn monotonic_from(previous: Option<&Self>) -> Self
Create a monotonic ULID based on a previous one
Trait Implementations§
Source§impl Clone for UlidIdentifier
impl Clone for UlidIdentifier
Source§fn clone(&self) -> UlidIdentifier
fn clone(&self) -> UlidIdentifier
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UlidIdentifier
impl Debug for UlidIdentifier
Source§impl Default for UlidIdentifier
impl Default for UlidIdentifier
Source§impl<'de> Deserialize<'de> for UlidIdentifier
impl<'de> Deserialize<'de> for UlidIdentifier
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for UlidIdentifier
impl Display for UlidIdentifier
Source§impl<T: Prefix> From<&EntityId<T, UlidIdentifier>> for UlidIdentifier
Implement Into<UlidIdentifier> for references to ULID-based EntityId
impl<T: Prefix> From<&EntityId<T, UlidIdentifier>> for UlidIdentifier
Implement Into<UlidIdentifier> for references to ULID-based EntityId
Source§fn from(entity_id: &EntityId<T, UlidIdentifier>) -> Self
fn from(entity_id: &EntityId<T, UlidIdentifier>) -> Self
Converts to this type from the input type.
Source§impl<T: Prefix> From<EntityId<T, UlidIdentifier>> for UlidIdentifier
Implement Into<UlidIdentifier> for ULID-based EntityId
impl<T: Prefix> From<EntityId<T, UlidIdentifier>> for UlidIdentifier
Implement Into<UlidIdentifier> for ULID-based EntityId
Source§fn from(entity_id: EntityId<T, UlidIdentifier>) -> Self
fn from(entity_id: EntityId<T, UlidIdentifier>) -> Self
Converts to this type from the input type.
Source§impl From<Ulid> for UlidIdentifier
impl From<Ulid> for UlidIdentifier
Source§impl FromStr for UlidIdentifier
impl FromStr for UlidIdentifier
Source§impl Hash for UlidIdentifier
impl Hash for UlidIdentifier
Source§impl Identifier for UlidIdentifier
impl Identifier for UlidIdentifier
Source§impl PartialEq for UlidIdentifier
impl PartialEq for UlidIdentifier
Source§impl Serialize for UlidIdentifier
impl Serialize for UlidIdentifier
impl Copy for UlidIdentifier
impl Eq for UlidIdentifier
impl StructuralPartialEq for UlidIdentifier
Auto Trait Implementations§
impl Freeze for UlidIdentifier
impl RefUnwindSafe for UlidIdentifier
impl Send for UlidIdentifier
impl Sync for UlidIdentifier
impl Unpin for UlidIdentifier
impl UnwindSafe for UlidIdentifier
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