pub enum DiffGranularity {
Block,
Inline,
Smart {
replace_threshold: f32,
},
}Expand description
How Node::diff_with treats changed text nodes.
Variants§
Block
Whole-node text replacement (SetText) — the default diff behavior.
Inline
Character-level SpliceText islands.
Smart
Inline, but fall back to a whole SetText once the changed fraction
exceeds replace_threshold (0.0–1.0).
Trait Implementations§
Source§impl Clone for DiffGranularity
impl Clone for DiffGranularity
Source§fn clone(&self) -> DiffGranularity
fn clone(&self) -> DiffGranularity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiffGranularity
impl Debug for DiffGranularity
Source§impl Default for DiffGranularity
impl Default for DiffGranularity
Source§fn default() -> DiffGranularity
fn default() -> DiffGranularity
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DiffGranularity
impl<'de> Deserialize<'de> for DiffGranularity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DiffGranularity
impl PartialEq for DiffGranularity
Source§fn eq(&self, other: &DiffGranularity) -> bool
fn eq(&self, other: &DiffGranularity) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DiffGranularity
impl Serialize for DiffGranularity
impl Copy for DiffGranularity
impl StructuralPartialEq for DiffGranularity
Auto Trait Implementations§
impl Freeze for DiffGranularity
impl RefUnwindSafe for DiffGranularity
impl Send for DiffGranularity
impl Sync for DiffGranularity
impl Unpin for DiffGranularity
impl UnsafeUnpin for DiffGranularity
impl UnwindSafe for DiffGranularity
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