pub struct Queue<'a, E, S> { /* private fields */ }
Expand description
Wraps a Record
and gives it batch queue functionality.
Examples
let mut string = String::new();
let mut record = Record::new();
let mut queue = record.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.
source§impl<E: Edit, S: Slot> Queue<'_, E, S>
impl<E: Edit, S: Slot> Queue<'_, E, S>
sourcepub fn edit(&mut self, edit: E)
pub fn edit(&mut self, edit: E)
Queues a Record::edit
call.
sourcepub fn undo(&mut self)
pub fn undo(&mut self)
Queues a Record::undo
call.
sourcepub fn redo(&mut self)
pub fn redo(&mut self)
Queues a Record::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