pub struct DiffContext<'a> { /* private fields */ }Expand description
Shared context passed to all diff computations.
Holds references to both the previous and next Schema versions and
the RenameHints that guide rename detection.
§Examples
ⓘ
use toasty_core::schema::db::{DiffContext, RenameHints, Schema};
let previous = Schema::default();
let next = Schema::default();
let hints = RenameHints::new();
let cx = DiffContext::new(&previous, &next, &hints);
assert!(cx.previous().tables.is_empty());Implementations§
Source§impl<'a> DiffContext<'a>
impl<'a> DiffContext<'a>
Sourcepub fn new(
previous: &'a Schema,
next: &'a Schema,
rename_hints: &'a RenameHints,
) -> Self
pub fn new( previous: &'a Schema, next: &'a Schema, rename_hints: &'a RenameHints, ) -> Self
Creates a new diff context from the previous schema, the next schema, and the rename hints that map old IDs to new IDs.
Sourcepub fn rename_hints(&self) -> &'a RenameHints
pub fn rename_hints(&self) -> &'a RenameHints
Returns the rename hints for this diff.
Auto Trait Implementations§
impl<'a> Freeze for DiffContext<'a>
impl<'a> RefUnwindSafe for DiffContext<'a>
impl<'a> Send for DiffContext<'a>
impl<'a> Sync for DiffContext<'a>
impl<'a> Unpin for DiffContext<'a>
impl<'a> UnwindSafe for DiffContext<'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