pub enum Command {
None,
VerbEdit(VerbInvocation),
VerbInvocate(VerbInvocation),
Internal {
internal: Internal,
input_invocation: Option<VerbInvocation>,
},
VerbTrigger {
verb_id: VerbId,
input_invocation: Option<VerbInvocation>,
},
PatternEdit {
raw: String,
expr: BeTree<PatternOperator, PatternParts>,
},
Click(u16, u16),
DoubleClick(u16, u16),
}
Expand description
a command which may result in a change in the application state.
It may come from a shortcut, from the parsed input, from an argument given on launch.
Variants§
None
no command
VerbEdit(VerbInvocation)
a verb invocation, unfinished (user didn’t hit enter)
VerbInvocate(VerbInvocation)
verb invocation, finished (coming from –cmd, or after the user hit enter)
Internal
call of an internal done without the input (using a trigger key for example)
VerbTrigger
call of a verb done without the input (using a trigger key for example)
PatternEdit
a pattern being edited
Click(u16, u16)
a mouse click
DoubleClick(u16, u16)
a mouse double-click Always come after a simple click at same position
Implementations§
Source§impl Command
impl Command
pub fn empty() -> Command
pub fn is_none(&self) -> bool
pub fn as_verb_invocation(&self) -> Option<&VerbInvocation>
Sourcepub fn from_parts(cp: CommandParts, finished: bool) -> Self
pub fn from_parts(cp: CommandParts, finished: bool) -> Self
build a command from the parsed string representation
The command being finished is the difference between a command being edited and a command launched (which happens on enter in the input).
Sourcepub fn is_verb_invocated_from_input(&self) -> bool
pub fn is_verb_invocated_from_input(&self) -> bool
tells whether this action is a verb being invocated on enter in the input field
Sourcepub fn from_raw(raw: String, finished: bool) -> Self
pub fn from_raw(raw: String, finished: bool) -> Self
create a command from a raw input.
finished
makes the command an executed form,
it’s equivalent to using the Enter key in the Gui.
Sourcepub fn from_pattern(pattern: &InputPattern) -> Self
pub fn from_pattern(pattern: &InputPattern) -> Self
build a non executed command from a pattern
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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
Source§impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.