pub struct TextState { /* private fields */ }Expand description
A representation of how many changes took place in a Text
The purpose of this struct is merely to be compared with
previously acquired instances of itself, to just quickly check if
certain properties of the Text have changed.
Note that this is a Text agnostic struct, comparing the
TextStates from two different Texts is pointless.
Implementations§
Source§impl TextState
impl TextState
Sourcepub fn has_changed_since(&self, other: Self) -> bool
pub fn has_changed_since(&self, other: Self) -> bool
Wether there have been any changes to the Text since
this previous instance
Sourcepub fn bytes_have_changed_since(&self, other: Self) -> bool
pub fn bytes_have_changed_since(&self, other: Self) -> bool
Wether the Bytes have changed since this previous instance
Wether the Tags have changed since this previous instance
Note that this only tracks if Tags have been
added/removed. So if, for example, you replace a range where
no Tags existed, this would return false, even though the
position of Tags have changed internally.
Sourcepub fn has_structurally_changed_since(&self, other: Self) -> bool
pub fn has_structurally_changed_since(&self, other: Self) -> bool
Wether this Text has “structurally changed” since this
previous instance
A Text has structurally changed when printing it from the
same point could result in a different characters being
printed. This not only happens when the Bytes change, but
also with certain Tags, like Ghost and Conceal,
which also add and remove characters to be printed.
These Tags are called “meta tags” internally, since they
change the very structure of what Text has been printed.
Trait Implementations§
impl Copy for TextState
impl Eq for TextState
impl StructuralPartialEq for TextState
Auto Trait Implementations§
impl Freeze for TextState
impl RefUnwindSafe for TextState
impl Send for TextState
impl Sync for TextState
impl Unpin for TextState
impl UnwindSafe for TextState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.