pub struct ExecutionStringBuilder<'b> {
    pub sel_info: SelInfo<'b>,
    /* private fields */
}
Expand description

a temporary structure gathering selection and invocation parameters and able to generate an executable string from a verb’s execution pattern

Fields§

§sel_info: SelInfo<'b>

the current file selection

Implementations§

source§

impl<'b> ExecutionStringBuilder<'b>

source

pub fn without_invocation( sel_info: SelInfo<'b>, app_state: &'b AppState ) -> Self

constructor to use when there’s no invocation string (because we’re in the process of building one, for example when a verb is triggered from a key shortcut)

source

pub fn with_invocation( invocation_parser: &Option<InvocationParser>, sel_info: SelInfo<'b>, app_state: &'b AppState, invocation_args: Option<&String> ) -> Self

source

pub fn invocation_with_default( &self, verb_invocation: &VerbInvocation ) -> VerbInvocation

fills groups having a default value (after the colon)

This is used to fill the input in case on non auto_exec verb triggered with a key

source

pub fn path(&self, pattern: &str) -> PathBuf

build a path

source

pub fn shell_exec_string(&self, exec_pattern: &ExecPattern) -> String

build a shell compatible command, with escapings

source

pub fn sel_shell_exec_string( &self, exec_pattern: &ExecPattern, sel: Option<Selection<'_>> ) -> String

build a shell compatible command, with escapings, for a specific selection (this is intended for execution on all selections of a stage)

source

pub fn exec_token(&self, exec_pattern: &ExecPattern) -> Vec<String>

build a vec of tokens which can be passed to Command to launch an executable

source

pub fn sel_exec_token( &self, exec_pattern: &ExecPattern, sel: Option<Selection<'_>> ) -> Vec<String>

build a vec of tokens which can be passed to Command to launch an executable

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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 = _

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.