pub enum Damage {
None,
Lines {
from: u32,
to: u32,
},
Viewport,
Full,
}Expand description
The dirty region of the document to refresh. A join-semilattice ordered
None ⊑ Lines ⊑ Viewport ⊑ Full, so combining two damages always yields
one that covers both (never less). Line ranges are inclusive [from, to];
to == u32::MAX means “to the end of the document” (used when an edit
shifted every line below it).
Variants§
None
Nothing changed — an idle frame reuses everything.
Lines
The inclusive line range [from, to] changed.
Viewport
The whole visible region must repaint (scroll / resize), but the document’s shaped content is unchanged.
Full
Everything must be recomputed (buffer swap, theme change, full reflow).
Implementations§
Source§impl Damage
impl Damage
Sourcepub fn from_delta(d: LineDelta) -> Self
pub fn from_delta(d: LineDelta) -> Self
The changed span implied by a LineDelta: local if the line count
held, otherwise to end-of-document (every line below shifted).
Trait Implementations§
impl Copy for Damage
Source§impl<'de> Deserialize<'de> for Damage
impl<'de> Deserialize<'de> for Damage
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
impl Eq for Damage
Source§impl JsonSchema for Damage
impl JsonSchema for Damage
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Damage
Auto Trait Implementations§
impl Freeze for Damage
impl RefUnwindSafe for Damage
impl Send for Damage
impl Sync for Damage
impl Unpin for Damage
impl UnsafeUnpin for Damage
impl UnwindSafe for Damage
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