Trait Adapter

Source
pub trait Adapter {
    type MigrationType: Migration + ?Sized;
    type Error: Error + 'static;

    // Required methods
    fn applied_migrations(&mut self) -> Result<HashSet<Uuid>, Self::Error>;
    fn apply_migration(
        &mut self,
        _: &Self::MigrationType,
    ) -> Result<(), Self::Error>;
    fn revert_migration(
        &mut self,
        _: &Self::MigrationType,
    ) -> Result<(), Self::Error>;
}
Expand description

Trait necessary to adapt schemer’s migration management to a stateful backend.

Required Associated Types§

Source

type MigrationType: Migration + ?Sized

Type migrations must implement for this adapter.

Source

type Error: Error + 'static

Type of errors returned by this adapter.

Required Methods§

Source

fn applied_migrations(&mut self) -> Result<HashSet<Uuid>, Self::Error>

Returns the set of IDs for migrations that have been applied.

Source

fn apply_migration( &mut self, _: &Self::MigrationType, ) -> Result<(), Self::Error>

Apply a single migration.

Source

fn revert_migration( &mut self, _: &Self::MigrationType, ) -> Result<(), Self::Error>

Revert a single migration.

Implementors§