[−][src]Struct byte_mutator::undo_buffer::UndoBuffer
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.
Methods
impl UndoBuffer[src]
pub fn new(buf: &[u8]) -> Self[src]
pub fn len(&self) -> usize[src]
Used length of the writable buffer
pub fn is_empty(&self) -> bool[src]
Whether the writable buffer is empty
pub fn get_mut(&mut self) -> &mut [u8][src]
Returns a full mutable slice of the write buffer, and marks the entire thing as dirty.
pub fn get_mut_range(&mut self, start: usize, end: usize) -> &mut [u8][src]
Returns a mutable subslice of the buffer. Marks that region as dirty for future undo operations.
pub fn read(&self) -> &[u8][src]
Returns an immutable reference to the buffer in its current state
pub fn undo(&mut self)[src]
Undo all changes and set the write/readable buffer back to the original state
Trait Implementations
impl Clone for UndoBuffer[src]
fn clone(&self) -> UndoBuffer[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for UndoBuffer[src]
Auto Trait Implementations
impl Send for UndoBuffer
impl Sync for UndoBuffer
impl Unpin for UndoBuffer
impl UnwindSafe for UndoBuffer
impl RefUnwindSafe for UndoBuffer
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,