[][src]Struct undo::record::Queue

pub struct Queue<'a, C: Command, F> { /* fields omitted */ }

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.apply(Add('a'));
queue.apply(Add('b'));
queue.apply(Add('c'));
assert_eq!(string, "");
queue.commit(&mut string)?;
assert_eq!(string, "abc");

Implementations

impl<C: Command, F: FnMut(Signal), '_> Queue<'_, C, F>[src]

pub fn apply(&mut self, command: C)[src]

Queues an apply action.

pub fn undo(&mut self)[src]

Queues an undo action.

pub fn redo(&mut self)[src]

Queues a redo action.

pub fn commit(self, target: &mut C::Target) -> Result<C>[src]

Applies the queued commands.

Errors

If an error occurs, it stops applying the commands and returns the error.

pub fn cancel(self)[src]

Cancels the queued actions.

pub fn queue(&mut self) -> Queue<'_, C, F>[src]

Returns a queue.

pub fn checkpoint(&mut self) -> Checkpoint<'_, C, F>[src]

Returns a checkpoint.

Trait Implementations

impl<'a, C: Command, F> From<&'a mut Record<C, F>> for Queue<'a, C, F>[src]

Auto Trait Implementations

impl<'a, C, F> RefUnwindSafe for Queue<'a, C, F> where
    C: RefUnwindSafe,
    F: RefUnwindSafe
[src]

impl<'a, C, F> Send for Queue<'a, C, F> where
    C: Send,
    F: Send
[src]

impl<'a, C, F> Sync for Queue<'a, C, F> where
    C: Sync,
    F: Sync
[src]

impl<'a, C, F> Unpin for Queue<'a, C, F> where
    C: Unpin
[src]

impl<'a, C, F> !UnwindSafe for Queue<'a, C, F>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.