#[non_exhaustive]pub enum SectionChange {
Same {
old: Section,
new: Section,
},
Added(Section),
Removed(Section),
Changed {
old: Section,
new: Section,
old_words: Vec<Range<usize>>,
new_words: Vec<Range<usize>>,
},
}Expand description
What happened to one section between the old and the new version.
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.
Same
Same kind and same text on both sides, but for the frame, the width of runs of spaces and where the layout wraps.
Added(Section)
Removed(Section)
Changed
Same kind, different text: old_words / new_words are char ranges into each side’s plain text
(lines.iter().map(Line::plain).collect::<String>() over its Block::Lines and Block::DoubleHeight), ready for
document::highlight. Empty for sections with no words to mark (pictures, Mermaid diagrams, a change of
spacing alone).
Trait Implementations§
Source§impl Clone for SectionChange
impl Clone for SectionChange
Source§impl Debug for SectionChange
impl Debug for SectionChange
impl Eq for SectionChange
Source§impl PartialEq for SectionChange
impl PartialEq for SectionChange
impl StructuralPartialEq for SectionChange
Auto Trait Implementations§
impl Forget for SectionChange
impl Freeze for SectionChangewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Block>: Freeze,
PhantomData<Range<usize>>: Freeze,
impl Move for SectionChange
impl RefUnwindSafe for SectionChange
impl Send for SectionChange
impl Sync for SectionChange
impl Unpin for SectionChange
impl UnsafeUnpin for SectionChangewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Block>: UnsafeUnpin,
PhantomData<Range<usize>>: UnsafeUnpin,
impl UnwindSafe for SectionChange
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