pub struct KeyInterner { /* private fields */ }Expand description
String interner for key paths to avoid repeated allocations.
Useful when the same JSON/YAML key paths are compared many times during diff or merge operations on large files.
§Example
use suture_driver::KeyInterner;
let mut interner = KeyInterner::new();
let a = interner.intern("config/server/host");
let b = interner.intern("config/server/host");
assert_eq!(a, b);
assert_eq!(interner.resolve(a), "config/server/host");Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyInterner
impl RefUnwindSafe for KeyInterner
impl Send for KeyInterner
impl Sync for KeyInterner
impl Unpin for KeyInterner
impl UnsafeUnpin for KeyInterner
impl UnwindSafe for KeyInterner
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