[−][src]Enum undo::Signal
The signal sent when the record, the history, or the receiver changes.
When one of these states changes, they will send a corresponding signal to the user.
For example, if the record can no longer redo any commands, it sends a Redo(false)
signal to tell the user.
Examples
let history = History::builder() .connect(|signal| match signal { Signal::Undo(on) => println!("undo: {}", on), Signal::Redo(on) => println!("redo: {}", on), Signal::Saved(on) => println!("saved: {}", on), Signal::Current { old, new } => println!("current: {} -> {}", old, new), Signal::Root { old, new } => println!("root: {} -> {}", old, new), }) .default();
Variants
Undo(bool)
Says if the record can undo.
This signal will be emitted when the records ability to undo changes.
Redo(bool)
Says if the record can redo.
This signal will be emitted when the records ability to redo changes.
Saved(bool)
Says if the receiver is in a saved state.
This signal will be emitted when the record enters or leaves its receivers saved state.
Current
Says if the current command has changed.
This signal will be emitted when the current command has changed. This includes
when two commands have been merged, in which case old == new
.
Fields of Current
Root
Says if the current branch, or root, has changed.
This is only emitted from History
.
Fields of Root
Trait Implementations
impl PartialEq<Signal> for Signal
[src]
impl PartialOrd<Signal> for Signal
[src]
fn partial_cmp(&self, other: &Signal) -> Option<Ordering>
[src]
fn lt(&self, other: &Signal) -> bool
[src]
fn le(&self, other: &Signal) -> bool
[src]
fn gt(&self, other: &Signal) -> bool
[src]
fn ge(&self, other: &Signal) -> bool
[src]
impl Eq for Signal
[src]
impl Copy for Signal
[src]
impl Ord for Signal
[src]
fn cmp(&self, other: &Signal) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Clone for Signal
[src]
fn clone(&self) -> Signal
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Signal
[src]
impl Hash for Signal
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,