pub struct Queue<'a, E, S> { /* private fields */ }
Expand description
Wraps a History
and gives it batch queue functionality.
Examples
let mut string = String::new();
let mut history = History::new();
let mut queue = history.queue();
queue.edit(Add('a'));
queue.edit(Add('b'));
queue.edit(Add('c'));
assert_eq!(string, "");
queue.commit(&mut string);
assert_eq!(string, "abc");
Implementations§
source§impl<E, S> Queue<'_, E, S>
impl<E, S> Queue<'_, E, S>
sourcepub fn checkpoint(&mut self) -> Checkpoint<'_, E, S>
pub fn checkpoint(&mut self) -> Checkpoint<'_, E, S>
Returns a checkpoint.
sourcepub fn edit(&mut self, edit: E)
pub fn edit(&mut self, edit: E)
Queues a History::edit
call.
sourcepub fn undo(&mut self)
pub fn undo(&mut self)
Queues a History::undo
call.
sourcepub fn redo(&mut self)
pub fn redo(&mut self)
Queues a History::redo
call.
Trait Implementations§
Auto Trait Implementations§
impl<'a, E, S> RefUnwindSafe for Queue<'a, E, S>where E: RefUnwindSafe, S: RefUnwindSafe,
impl<'a, E, S> Send for Queue<'a, E, S>where E: Send, S: Send,
impl<'a, E, S> Sync for Queue<'a, E, S>where E: Sync, S: Sync,
impl<'a, E, S> Unpin for Queue<'a, E, S>where E: Unpin,
impl<'a, E, S> !UnwindSafe for Queue<'a, E, S>
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