#[non_exhaustive]pub enum DiffKind {
String,
Slice,
Set,
Map,
Custom(&'static str),
}
Available on crate feature
diff
only.Expand description
A discriminant that represents how a diff should be formatted.
You would format a diff of two strings differently from a diff of two slices. Diff “kinds” exist to pass this information along to the formatter.
The Custom
variant exists for when you’re implementing Diffable
on your own types and
the none of the provided kinds are suitable. Note that the provided
formatter won’t know what to do with custom diff kinds, so you would
need to implement your own formatter in this case.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
String
Diffing strings.
Slice
Diffing slices.
Set
Diffing sets.
Map
Diffing maps.
Custom(&'static str)
Provide your own custom diff kind.
Trait Implementations§
impl Copy for DiffKind
impl Eq for DiffKind
impl StructuralPartialEq for DiffKind
Auto Trait Implementations§
impl Freeze for DiffKind
impl RefUnwindSafe for DiffKind
impl Send for DiffKind
impl Sync for DiffKind
impl Unpin for DiffKind
impl UnwindSafe for DiffKind
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