pub struct SchemaDiff<'a> { /* private fields */ }Expand description
The top-level diff between two database schemas.
Contains a TablesDiff describing created, dropped, and altered tables.
Constructed via SchemaDiff::from.
§Examples
ⓘ
use toasty_core::schema::db::{SchemaDiff, RenameHints, Schema};
let previous = Schema::default();
let next = Schema::default();
let hints = RenameHints::new();
let diff = SchemaDiff::from(&previous, &next, &hints);
assert!(diff.is_empty());Implementations§
Source§impl<'a> SchemaDiff<'a>
impl<'a> SchemaDiff<'a>
Sourcepub fn from(
from: &'a Schema,
to: &'a Schema,
rename_hints: &'a RenameHints,
) -> Self
pub fn from( from: &'a Schema, to: &'a Schema, rename_hints: &'a RenameHints, ) -> Self
Computes the diff between two schemas, using the provided rename hints.
Sourcepub fn tables(&self) -> &TablesDiff<'a>
pub fn tables(&self) -> &TablesDiff<'a>
Returns the table-level diff.
Auto Trait Implementations§
impl<'a> Freeze for SchemaDiff<'a>
impl<'a> RefUnwindSafe for SchemaDiff<'a>
impl<'a> Send for SchemaDiff<'a>
impl<'a> Sync for SchemaDiff<'a>
impl<'a> Unpin for SchemaDiff<'a>
impl<'a> UnwindSafe for SchemaDiff<'a>
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