pub struct MigrationId(pub u64);Expand description
Unique identifier for a migration operation.
Tuple Fields§
§0: u64Implementations§
Source§impl MigrationId
impl MigrationId
Sourcepub fn new(slot: u16) -> Self
pub fn new(slot: u16) -> Self
Generate a new migration ID from timestamp, slot, and random bits.
The ID combines nanosecond timestamp with the slot number and 16 bits
of randomness. The random component prevents collisions when the
system clock is unavailable (unwrap_or_default returns zero) or
when two migrations for the same slot start within the same nanosecond.
Trait Implementations§
Source§impl Clone for MigrationId
impl Clone for MigrationId
Source§fn clone(&self) -> MigrationId
fn clone(&self) -> MigrationId
Returns a duplicate 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 MigrationId
impl Debug for MigrationId
Source§impl<'de> Deserialize<'de> for MigrationId
impl<'de> Deserialize<'de> for MigrationId
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 Hash for MigrationId
impl Hash for MigrationId
Source§impl PartialEq for MigrationId
impl PartialEq for MigrationId
Source§impl Serialize for MigrationId
impl Serialize for MigrationId
impl Copy for MigrationId
impl Eq for MigrationId
impl StructuralPartialEq for MigrationId
Auto Trait Implementations§
impl Freeze for MigrationId
impl RefUnwindSafe for MigrationId
impl Send for MigrationId
impl Sync for MigrationId
impl Unpin for MigrationId
impl UnsafeUnpin for MigrationId
impl UnwindSafe for MigrationId
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