pub enum EditCommand {
Copy,
Cut,
Paste(String),
SelectAll,
}Expand description
The clipboard/selection command vocabulary, flat-re-exported from
frust-core::event (and also available through
authoring::EditCommand).
InputEvent::EditCommand delivers one of
EditCommand::Copy, EditCommand::Cut, EditCommand::Paste or
EditCommand::SelectAll down the focus chain, already decoded by the shell
from the platform’s own gesture — Cmd+C on macOS, Ctrl+C or Ctrl+Insert
elsewhere, a hardware clipboard key, an Android ACTION_PROCESS_TEXT, an iOS
edit-menu tap — so app and design-system code never decodes a chord itself.
Lifted flat rather than left inside authoring for CursorIcon’s reason:
a design system’s own context menu or toolbar builder names these verbs in
its public API without being a widget author. Paste carries its text
because the shell has already read the host clipboard; its Debug redacts
that text, since a paste payload can be a password or a token.
A decoded clipboard/selection verb for the focused editable, so no widget decodes OS chords.
Copy/Cut carry nothing (the widget answers with EventCtx::write_clipboard); Paste
carries the text the shell already read. A widget may refuse any verb. Exhaustive on purpose:
a fifth verb must break every match.
Variants§
Copy
Copy the selection to the host clipboard, leaving the document unchanged.
Cut
Copy the selection, then delete it.
Paste(String)
Replace the selection (or insert at the caret) with this text.
SelectAll
Select the widget’s entire content.
Trait Implementations§
Source§impl Clone for EditCommand
impl Clone for EditCommand
Source§fn clone(&self) -> EditCommand
fn clone(&self) -> EditCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EditCommand
impl Debug for EditCommand
impl Eq for EditCommand
Source§impl PartialEq for EditCommand
impl PartialEq for EditCommand
impl StructuralPartialEq for EditCommand
Auto Trait Implementations§
impl Freeze for EditCommand
impl RefUnwindSafe for EditCommand
impl Send for EditCommand
impl Sync for EditCommand
impl Unpin for EditCommand
impl UnsafeUnpin for EditCommand
impl UnwindSafe for EditCommand
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.