Struct UndoStatus
pub struct UndoStatus {
pub can_undo: bool,
pub can_redo: bool,
pub undo_summary: Option<String>,
pub redo_summary: Option<String>,
}Expand description
What the live undo history can do right now, as a widget sees it.
Published by the host once per frame. Every field is derived from the real
UndoLog at publish time and is scoped to the
local author exactly as Ctrl+Z is — so can_undo is false precisely when
pressing Ctrl+Z would do nothing, and a control rendered from it cannot
promise an action the shortcut would refuse.
Fields§
§can_undo: boolThere is an action this user can undo.
can_redo: boolThere is an action this user can redo.
undo_summary: Option<String>Short description of the action undo would revert, derived from the
change itself ("+12 -3 chars", "+1 item", "2 fields") by the same
producer the history pane uses — see
history_source::change_summary.
None when there is nothing to undo. It is deliberately never a guess:
a change whose effect cannot be described reports
NO_VISIBLE_CHANGE.
redo_summary: Option<String>The mirror of undo_summary for redo: what
re-applying would put back.
Implementations§
§impl UndoStatus
impl UndoStatus
pub fn empty() -> UndoStatus
pub fn empty() -> UndoStatus
The status of a history in which nothing has happened yet.
pub fn can(&self, which: UndoRequest) -> bool
pub fn can(&self, which: UndoRequest) -> bool
Whether the verb which is available.
pub fn summary(&self, which: UndoRequest) -> Option<&str>
pub fn summary(&self, which: UndoRequest) -> Option<&str>
The summary for the verb which, if any.
pub fn description(&self, which: UndoRequest) -> String
pub fn description(&self, which: UndoRequest) -> String
The sentence an assistive technology should hear as the control’s description: what the verb would do, or the reason it is unavailable.
"Nothing to undo" when unavailable — never a description of an action
that is not there.
Trait Implementations§
§impl Clone for UndoStatus
impl Clone for UndoStatus
§fn clone(&self) -> UndoStatus
fn clone(&self) -> UndoStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for UndoStatus
impl Debug for UndoStatus
§impl Default for UndoStatus
impl Default for UndoStatus
§fn default() -> UndoStatus
fn default() -> UndoStatus
§impl PartialEq for UndoStatus
impl PartialEq for UndoStatus
impl Eq for UndoStatus
impl StructuralPartialEq for UndoStatus
Auto Trait Implementations§
impl Freeze for UndoStatus
impl RefUnwindSafe for UndoStatus
impl Send for UndoStatus
impl Sync for UndoStatus
impl Unpin for UndoStatus
impl UnsafeUnpin for UndoStatus
impl UnwindSafe for UndoStatus
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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