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