pub struct MigrationRegistry { /* private fields */ }Expand description
Registry of schema migrations.
Stores migrations between schema versions and provides path-finding for multi-hop migrations (e.g., v1 → v2 → v3).
Implementations§
Source§impl MigrationRegistry
impl MigrationRegistry
Sourcepub fn register(&self, migration: Migration) -> Result<()>
pub fn register(&self, migration: Migration) -> Result<()>
Register a migration.
If a migration between the same schemas already exists, it is replaced.
Sourcepub fn unregister(&self, from_hash: u64, to_hash: u64) -> Option<Migration>
pub fn unregister(&self, from_hash: u64, to_hash: u64) -> Option<Migration>
Unregister a migration.
Sourcepub fn find_direct(&self, from_hash: u64, to_hash: u64) -> Option<Migration>
pub fn find_direct(&self, from_hash: u64, to_hash: u64) -> Option<Migration>
Find a direct migration from one schema to another.
Sourcepub fn find_path(&self, from_hash: u64, to_hash: u64) -> Option<Vec<Migration>>
pub fn find_path(&self, from_hash: u64, to_hash: u64) -> Option<Vec<Migration>>
Find the migration path from one schema to another.
Returns the migrations in order, or None if no path exists.
Sourcepub fn migrate(
&self,
arena: &Arena,
offset: ArenaOffset,
from_hash: u64,
to_hash: u64,
) -> Result<ArenaOffset>
pub fn migrate( &self, arena: &Arena, offset: ArenaOffset, from_hash: u64, to_hash: u64, ) -> Result<ArenaOffset>
Apply migration to arena data.
Finds the migration path and applies each migration in sequence.
Sourcepub fn migrations_from(&self, from_hash: u64) -> Vec<Migration>
pub fn migrations_from(&self, from_hash: u64) -> Vec<Migration>
Get migrations from a specific schema.
Sourcepub fn migrations_to(&self, to_hash: u64) -> Vec<Migration>
pub fn migrations_to(&self, to_hash: u64) -> Vec<Migration>
Get migrations to a specific schema.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MigrationRegistry
impl !RefUnwindSafe for MigrationRegistry
impl Send for MigrationRegistry
impl Sync for MigrationRegistry
impl Unpin for MigrationRegistry
impl !UnwindSafe for MigrationRegistry
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.