Struct migrant_lib::Migrator[][src]

pub struct Migrator { /* fields omitted */ }

Migration applicator

Implementations

impl Migrator[src]

pub fn with_config(config: &Config) -> Self[src]

Initialize a new Migrator with a given &Config

pub fn direction(&mut self, dir: Direction) -> &mut Self[src]

Set direction. Default is Up. Up => run up.sql. Down => run down.sql.

pub fn force(&mut self, force: bool) -> &mut Self[src]

Set force to forcefully apply migrations regardless of errors

pub fn fake(&mut self, fake: bool) -> &mut Self[src]

Set fake to fake application of migrations. Applied migrations table will be updated as if migrations were actually run.

pub fn all(&mut self, all: bool) -> &mut Self[src]

Set all to run all remaining available migrations in the given direction

pub fn show_output(&mut self, show_output: bool) -> &mut Self[src]

Toggle migration application output. Default is true

pub fn swallow_completion(&mut self, swallow_completion: bool) -> &mut Self[src]

Don’t return any ErrorKind::MigrationComplete errors when running Migrator::apply

All other errors will still be returned

pub fn apply(&self) -> Result<()>[src]

Apply migrations using current configuration

Returns an ErrorKind::MigrationComplete if all migrations in the given direction have already been applied, unless swallow_completion is set to true.

Trait Implementations

impl Clone for Migrator[src]

impl Debug for Migrator[src]

Auto Trait Implementations

impl !RefUnwindSafe for Migrator

impl !Send for Migrator

impl !Sync for Migrator

impl Unpin for Migrator

impl !UnwindSafe for Migrator

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.