pub struct UniqueId { /* private fields */ }
Expand description
Represents a UUID with a custom epoch of midnight January 1st 2021.
Implementations§
source§impl UniqueId
impl UniqueId
sourcepub fn nil() -> Self
pub fn nil() -> Self
Returns a ‘nil’ UniqueId
that has every field set to 0
.
This value may appear multiple times in a Roblox file safely.
sourcepub fn new(index: u32, time: u32, random: i64) -> Self
pub fn new(index: u32, time: u32, random: i64) -> Self
Returns a new UniqueId
with each component set to the passed
values.
sourcepub fn now() -> Result<Self, CrateError>
pub fn now() -> Result<Self, CrateError>
Returns a new UniqueId.
sourcepub fn is_nil(&self) -> bool
pub fn is_nil(&self) -> bool
Returns whether this UniqueId
is ‘nil’ or not. That is, whether
every field of the UniqueId is set to 0
.
sourcepub fn time(&self) -> u32
pub fn time(&self) -> u32
The ‘time’ portion of the UniqueId. This is the number of seconds since 1 January 2021.
Pending system time errors, this value will always be above 0
.
Trait Implementations§
source§impl PartialEq for UniqueId
impl PartialEq for UniqueId
impl Copy for UniqueId
impl Eq for UniqueId
impl StructuralEq for UniqueId
impl StructuralPartialEq for UniqueId
Auto Trait Implementations§
impl RefUnwindSafe for UniqueId
impl Send for UniqueId
impl Sync for UniqueId
impl Unpin for UniqueId
impl UnwindSafe for UniqueId
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