pub struct MemMigrations { /* private fields */ }
Expand description

A collection of migrations stored in memory.

Implementations§

Trait Implementations§

source§

impl Debug for MemMigrations

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for MemMigrations

source§

fn default() -> MemMigrations

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for MemMigrations

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<MemMigrations, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Migrations for MemMigrations

§

type M = MemMigration

source§

fn get_migration(&self, name: &str) -> Option<<MemMigrations as Migrations>::M>

Gets the migration with the given name, if it exists
source§

fn latest(&self) -> Option<<MemMigrations as Migrations>::M>

Get the most recent migration (other than current) or None if no migrations have been created.
source§

fn migrations_since( &self, since: &Self::M ) -> Result<Vec<Self::M, Global>, Error>

Returns migrations since the given migration.
source§

fn all_migrations(&self) -> Result<Vec<Self::M, Global>, Error>

Returns all migrations
source§

fn unapplied_migrations( &self, conn: &impl ConnectionMethods ) -> Result<Vec<Self::M, Global>, Error>

Get migrations which have not yet been applied to the database
source§

fn last_applied_migration( &self, conn: &impl ConnectionMethods ) -> Result<Option<Self::M>, Error>

Get the last migration that has been applied to the database or None if no migrations have been applied
source§

impl MigrationsMut for MemMigrations

source§

fn current(&mut self) -> &mut <MemMigrations as Migrations>::M

Get a pseudo-migration representing the current state as determined by the last build of models. This does not necessarily match the current state of the database if migrations have not yet been applied. Read more
source§

fn clear_current(&mut self) -> Result<(), Error>

Clears the current state (as would be returned by the current method).
source§

fn new_migration(&self, name: &str) -> <MemMigrations as Migrations>::M

Construct a new, uninitialized migration. You may want to use create_migration instead, which provides higher-level functionality.
source§

fn add_migration( &mut self, m: <MemMigrations as Migrations>::M ) -> Result<(), Error>

Adds a migration constructed from new_migration into the set of migrations. Should be called after filling in the migration details. Unnecessary when using create_migration.
source§

fn clear_migrations( &mut self, conn: &impl ConnectionMethods ) -> Result<(), Error>

Clears all migrations – deleting them from this object (and any storage backing it) and deleting the record of their existence/application from the database. The database schema is not modified, nor is any other data removed. Use carefully.
source§

fn create_migration( &mut self, backend: &impl Backend, name: &str, from: Option<&Self::M> ) -> Result<bool, Error>

Create a migration from -> current named name. From may be None, in which case the migration is created from an empty database. Returns true if a migration was created, false if from and current represent identical states.
source§

fn create_migration_to( &mut self, backend: &impl Backend, name: &str, from: Option<&Self::M>, to_db: ADB ) -> Result<bool, Error>

Create a migration from -> to_db named name. From may be None, in which case the migration is created from an empty database. Returns true if a migration was created, false if from and current represent identical states.
source§

impl Serialize for MemMigrations

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Fake for T

§

fn fake<U>(&self) -> Uwhere Self: FakeBase<U>,

§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> Uwhere R: Rng + ?Sized, Self: FakeBase<U>,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,