#[non_exhaustive]pub enum Mode {
Lines,
Trim,
TrimAll,
}Expand description
Normalization strategy shared by all of the assertion macros.
It is exposed so the exact same normalization the macros use can be reused
outside of assertions – for example to pre-process snapshots, build
whitespace-insensitive hash/sort keys, or write your own comparison via
normalize.
This enum is #[non_exhaustive]: additional modes may be added in future
releases without a breaking change.
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.
Lines
Compare line by line, treating \n and \r\n as equivalent. A single
trailing newline is ignored (a consequence of str::lines).
Trim
Like Mode::Lines, but additionally trims each line and drops empty
lines.
TrimAll
Removes all whitespace anywhere in the string (spaces, tabs, and line breaks). Useful for comparing minified and pretty-printed formats.
Trait Implementations§
impl Copy for Mode
impl Eq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl Freeze for Mode
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnsafeUnpin for Mode
impl UnwindSafe for Mode
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