Enum broot::command::Command

source ·
pub enum Command {
    None,
    VerbEdit(VerbInvocation),
    VerbInvocate(VerbInvocation),
    Internal {
        internal: Internal,
        input_invocation: Option<VerbInvocation>,
    },
    VerbTrigger {
        index: usize,
        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

Fields

§internal: Internal
§input_invocation: Option<VerbInvocation>

call of an internal done without the input (using a trigger key for example)

§

VerbTrigger

Fields

§index: usize
§input_invocation: Option<VerbInvocation>

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

source

pub fn empty() -> Command

source

pub fn as_verb_invocation(&self) -> Option<&VerbInvocation>

source

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).

source

pub fn is_verb_invocated_from_input(&self) -> bool

tells whether this action is a verb being invocated on enter in the input field

source

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.

source

pub fn from_pattern(pattern: &InputPattern) -> Self

build a non executed command from a pattern

Trait Implementations§

source§

impl Clone for Command

source§

fn clone(&self) -> Command

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Command

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Command

source§

fn default() -> Command

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> ToOwned for Twhere
T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.