pub struct MigrationId { /* private fields */ }Expand description
A typed compound migration identity; it is never delimiter-joined.
Implementations§
Source§impl MigrationId
impl MigrationId
Sourcepub fn new(
app_label: impl Into<String>,
name: impl Into<String>,
) -> Result<Self, Diagnostic>
pub fn new( app_label: impl Into<String>, name: impl Into<String>, ) -> Result<Self, Diagnostic>
Validate and construct a compound migration identity.
Sourcepub const fn from_components(
app_label: MigrationAppLabel,
name: MigrationName,
) -> Self
pub const fn from_components( app_label: MigrationAppLabel, name: MigrationName, ) -> Self
Construct from already validated components.
Sourcepub const fn app_label(&self) -> &MigrationAppLabel
pub const fn app_label(&self) -> &MigrationAppLabel
Return the application-label component.
Sourcepub const fn name(&self) -> &MigrationName
pub const fn name(&self) -> &MigrationName
Return the filename-stem name component.
Sourcepub fn canonical_bytes(&self) -> Result<Vec<u8>, Diagnostic>
pub fn canonical_bytes(&self) -> Result<Vec<u8>, Diagnostic>
Return exact canonical compound-ID bytes.
Sourcepub fn ledger_key(&self) -> Result<MigrationLedgerKey, Diagnostic>
pub fn ledger_key(&self) -> Result<MigrationLedgerKey, Diagnostic>
Derive the domain-separated ledger key for this compound identity.
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 (const: unstable) · 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
impl Eq for MigrationId
Source§impl Hash for MigrationId
impl Hash for MigrationId
Source§impl Ord for MigrationId
impl Ord for MigrationId
Source§fn cmp(&self, other: &MigrationId) -> Ordering
fn cmp(&self, other: &MigrationId) -> Ordering
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 PartialEq for MigrationId
impl PartialEq for MigrationId
Source§impl PartialOrd for MigrationId
impl PartialOrd for MigrationId
Source§impl Serialize for MigrationId
impl Serialize 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