pub struct RandomID { /* private fields */ }Expand description
The RandomID class is similar to v4 UUIDs. To obtain the maximum amount of entropy, all bits are random and no version information is stored in them. The only null value for the RandomID is all zeroes. Lastly, the only permissible format for the string version of the RandomID has all letters in lowercase and dashes are placed in the same places as for UUIDs.
Implementations§
Source§impl RandomID
impl RandomID
Sourcepub fn from(data: &str) -> Option<RandomID>
pub fn from(data: &str) -> Option<RandomID>
Creates a RandomID from an existing string and ensures that formatting is correct.
Sourcepub fn from_userid(uid: &UserID) -> Option<RandomID>
pub fn from_userid(uid: &UserID) -> Option<RandomID>
Creates a RandomID from a Mensago UserID instance if compatible. All RandomIDs are valid UserIDs, but not the other way around.
Trait Implementations§
Source§impl PartialOrd for RandomID
impl PartialOrd for RandomID
impl StructuralPartialEq for RandomID
Auto Trait Implementations§
impl Freeze for RandomID
impl RefUnwindSafe for RandomID
impl Send for RandomID
impl Sync for RandomID
impl Unpin for RandomID
impl UnwindSafe for RandomID
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