pub struct UndoBuffer { /* private fields */ }
Expand description
Fixed size buffer with an original state and a writeable buffer. Tracks which region of the buffer has been exposed for changes and enables an undo of those changes.
Implementations§
Source§impl UndoBuffer
impl UndoBuffer
pub fn new(buf: &[u8]) -> Self
Sourcepub fn get_mut(&mut self) -> &mut [u8] ⓘ
pub fn get_mut(&mut self) -> &mut [u8] ⓘ
Returns a full mutable slice of the write buffer, and marks the entire thing as dirty.
Sourcepub fn get_mut_range(&mut self, start: usize, end: usize) -> &mut [u8] ⓘ
pub fn get_mut_range(&mut self, start: usize, end: usize) -> &mut [u8] ⓘ
Returns a mutable subslice of the buffer. Marks that region as dirty for future undo operations.
Trait Implementations§
Source§impl Clone for UndoBuffer
impl Clone for UndoBuffer
Source§fn clone(&self) -> UndoBuffer
fn clone(&self) -> UndoBuffer
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 UndoBuffer
impl RefUnwindSafe for UndoBuffer
impl Send for UndoBuffer
impl Sync for UndoBuffer
impl Unpin for UndoBuffer
impl UnwindSafe for UndoBuffer
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