pub struct DoUndoActions { /* private fields */ }Expand description
A command backed by two closures: one for do_it and one for undo_it.
This is the Rust equivalent of the C# DoUndoActions class. Use it for
simple operations where capturing state in closures is natural.
For operations that share state with an owning object (e.g. text editing),
consider using std::rc::Rc<std::cell::RefCell<T>> to share mutable state
between the owning widget and the undo command closures.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DoUndoActions
impl !RefUnwindSafe for DoUndoActions
impl !Send for DoUndoActions
impl !Sync for DoUndoActions
impl Unpin for DoUndoActions
impl UnsafeUnpin for DoUndoActions
impl !UnwindSafe for DoUndoActions
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more