pub struct HistoryFile { /* private fields */ }Expand description
History file containing the record of all applied migrations
Implementations§
Source§impl HistoryFile
impl HistoryFile
Sourcepub fn load_or_default(path: impl AsRef<Path>) -> Result<Self>
pub fn load_or_default(path: impl AsRef<Path>) -> Result<Self>
Loads the history file, or returns an empty one if it does not exist
pub fn migrations(&self) -> &[HistoryFileMigration]
Sourcepub fn next_migration_number(&self) -> u32
pub fn next_migration_number(&self) -> u32
Get the next migration number by parsing the last migration’s name
Sourcepub fn add_migration(&mut self, migration: HistoryFileMigration)
pub fn add_migration(&mut self, migration: HistoryFileMigration)
Add a migration to the history
Sourcepub fn remove_migration(&mut self, index: usize)
pub fn remove_migration(&mut self, index: usize)
Remove a migration from the history by index
Trait Implementations§
Source§impl Clone for HistoryFile
impl Clone for HistoryFile
Source§fn clone(&self) -> HistoryFile
fn clone(&self) -> HistoryFile
Returns a duplicate of the value. Read more
1.0.0 · 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 HistoryFile
impl Debug for HistoryFile
Source§impl Default for HistoryFile
impl Default for HistoryFile
Source§impl<'de> Deserialize<'de> for HistoryFile
impl<'de> Deserialize<'de> for HistoryFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for HistoryFile
impl Display for HistoryFile
Source§impl FromStr for HistoryFile
impl FromStr for HistoryFile
Auto Trait Implementations§
impl Freeze for HistoryFile
impl RefUnwindSafe for HistoryFile
impl Send for HistoryFile
impl Sync for HistoryFile
impl Unpin for HistoryFile
impl UnwindSafe for HistoryFile
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