pub struct StateChange {
pub change_type: StateChangeType,
pub old_version: u64,
pub new_version: u64,
pub affected_region: Option<Range<usize>>,
}Expand description
State change record
Fields§
§change_type: StateChangeTypeChange type
old_version: u64Old version number
new_version: u64New version number
affected_region: Option<Range<usize>>Affected region (character offset range)
Implementations§
Source§impl StateChange
impl StateChange
Sourcepub fn new(
change_type: StateChangeType,
old_version: u64,
new_version: u64,
) -> Self
pub fn new( change_type: StateChangeType, old_version: u64, new_version: u64, ) -> Self
Create a new state change record without an affected region.
Sourcepub fn with_region(self, region: Range<usize>) -> Self
pub fn with_region(self, region: Range<usize>) -> Self
Attach the affected character range to this change record.
Trait Implementations§
Source§impl Clone for StateChange
impl Clone for StateChange
Source§fn clone(&self) -> StateChange
fn clone(&self) -> StateChange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StateChange
impl RefUnwindSafe for StateChange
impl Send for StateChange
impl Sync for StateChange
impl Unpin for StateChange
impl UnwindSafe for StateChange
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