pub struct SourceEdit {
pub start_byte: usize,
pub old_end_byte: usize,
pub new_end_byte: usize,
}Available on crate feature
runtime only.Expand description
A byte-range edit description used to drive incremental highlighting.
Build one from a real edit signal (for example a textarea beforeinput
event) and pass it to Buffer::edit. start_byte and
old_end_byte index into the buffer’s previous source, while
new_end_byte indexes into the new source supplied alongside the edit.
use dioxus_code::advanced::SourceEdit;
// Insertion of one byte at offset 0.
let _edit = SourceEdit { start_byte: 0, old_end_byte: 0, new_end_byte: 1 };Fields§
§start_byte: usizeFirst byte that changed.
old_end_byte: usizeOne past the last byte of the replaced region in the previous source.
new_end_byte: usizeOne past the last byte of the inserted region in the new source.
Trait Implementations§
Source§impl Clone for SourceEdit
impl Clone for SourceEdit
Source§fn clone(&self) -> SourceEdit
fn clone(&self) -> SourceEdit
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 SourceEdit
impl Debug for SourceEdit
Source§impl PartialEq for SourceEdit
impl PartialEq for SourceEdit
Source§fn eq(&self, other: &SourceEdit) -> bool
fn eq(&self, other: &SourceEdit) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SourceEdit
impl Eq for SourceEdit
impl StructuralPartialEq for SourceEdit
Auto Trait Implementations§
impl Freeze for SourceEdit
impl RefUnwindSafe for SourceEdit
impl Send for SourceEdit
impl Sync for SourceEdit
impl Unpin for SourceEdit
impl UnsafeUnpin for SourceEdit
impl UnwindSafe for SourceEdit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.