Enum xplr::app::ExternalMsg[][src]

pub enum ExternalMsg {
Show variants ExplorePwd, ExplorePwdAsync, ExploreParentsAsync, Refresh, ClearScreen, FocusNext, FocusNextByRelativeIndex(usize), FocusNextByRelativeIndexFromInput, FocusPrevious, FocusPreviousByRelativeIndex(usize), FocusPreviousByRelativeIndexFromInput, FocusFirst, FocusLast, FocusPath(String), FocusPathFromInput, FocusByIndex(usize), FocusByIndexFromInput, FocusByFileName(String), ChangeDirectory(String), Enter, Back, LastVisitedPath, NextVisitedPath, FollowSymlink, BufferInput(String), BufferInputFromKey, SetInputBuffer(String), RemoveInputBufferLastCharacter, RemoveInputBufferLastWord, ResetInputBuffer, SwitchMode(String), SwitchModeBuiltin(String), SwitchModeCustom(String), PopMode, SwitchLayout(String), SwitchLayoutBuiltin(String), SwitchLayoutCustom(String), Call(Command), CallSilently(Command), BashExec(String), BashExecSilently(String), Select, SelectAll, SelectPath(String), UnSelect, UnSelectAll, UnSelectPath(String), ToggleSelection, ToggleSelectAll, ToggleSelectionByPath(String), ClearSelection, AddNodeFilter(NodeFilterApplicable), RemoveNodeFilter(NodeFilterApplicable), ToggleNodeFilter(NodeFilterApplicable), AddNodeFilterFromInput(NodeFilter), RemoveNodeFilterFromInput(NodeFilter), RemoveLastNodeFilter, ResetNodeFilters, ClearNodeFilters, AddNodeSorter(NodeSorterApplicable), RemoveNodeSorter(NodeSorter), ReverseNodeSorter(NodeSorter), ToggleNodeSorter(NodeSorterApplicable), ReverseNodeSorters, RemoveLastNodeSorter, ResetNodeSorters, ClearNodeSorters, LogInfo(String), LogSuccess(String), LogWarning(String), LogError(String), Quit, PrintResultAndQuit, PrintAppStateAndQuit, Debug(String), Terminate,
}

Variants

ExplorePwd
Expand description

Explore the present working directory and register the filtered nodes. This operation is expensive. So, try to avoid using it too often. Once exploration is done, it will auto Refresh the state.

ExplorePwdAsync
Expand description

Explore the present working directory and register the filtered nodes asynchronously. This operation happens asynchronously. That means, the xplr directory buffers won’t be updated immediately. Hence, it needs to be used with care and probably with special checks in place. To explore $PWD synchronously, use ExplorePwd instead. Once exploration is done, it will auto Refresh the state.

ExploreParentsAsync
Expand description

Explore the present working directory along with its parents and register the filtered nodes. This operation happens asynchronously. That means, the xplr directory buffers won’t be updated immediately. Hence, it needs to be used with care and probably with special checks in place. To explore just the $PWD synchronously, use ExplorePwd instead. Once exploration is done, it will auto Refresh the state.

Refresh
Expand description

Refresh the app state (uncluding UI). But it will not re-explore the directory if the working directory is the same. If there is some change in the working directory and you want to re-explore it, use the Explore message instead.

ClearScreen
Expand description

Clears the screen.

FocusNext
Expand description

Focus next node.

FocusNextByRelativeIndex(usize)
Expand description

Focus on the nth node relative to the current focus where n is a given value.

Example: FocusNextByRelativeIndex: 2

FocusNextByRelativeIndexFromInput
Expand description

Focus on the nth node relative to the current focus where n is read from the input buffer.

FocusPrevious
Expand description

Focus on the previous item.

FocusPreviousByRelativeIndex(usize)
Expand description

Focus on the -nth node relative to the current focus where n is a given value.

Example: FocusPreviousByRelativeIndex: 2

FocusPreviousByRelativeIndexFromInput
Expand description

Focus on the -nth node relative to the current focus where n is read from the input buffer.

FocusFirst
Expand description

Focus on the first node.

FocusLast
Expand description

Focus on the last node.

FocusPath(String)
Expand description

Focus on the given path.

Example: FocusPath: /tmp

FocusPathFromInput
Expand description

Focus on the path read from input buffer.

FocusByIndex(usize)
Expand description

Focus on the absolute nth node where n is a given value.

Example: FocusByIndex: 2

FocusByIndexFromInput
Expand description

Focus on the absolute nth node where n is read from the input buffer.

FocusByFileName(String)
Expand description

Focus on the file by name from the present working directory.

Example: FocusByFileName: README.md

ChangeDirectory(String)
Expand description

Change the present working directory ($PWD)

Example: ChangeDirectory: /tmp

Enter
Expand description

Enter into the currently focused path if it’s a directory.

Back
Expand description

Go back to the parent directory.

LastVisitedPath
Expand description

Go to the last path visited.

NextVisitedPath
Expand description

Go to the next path visited.

Expand description

Follow the symlink under focus to its actual location.

BufferInput(String)
Expand description

Append/buffer the given string into the input buffer.

Example: BufferInput: foo

BufferInputFromKey
Expand description

Append/buffer the characted read from a keyboard input into the input buffer.

SetInputBuffer(String)
Expand description

Set/rewrite the input buffer with the given string. When the input buffer is not-null (even if empty string) it will show in the UI.

Example: SetInputBuffer: foo

RemoveInputBufferLastCharacter
Expand description

Remove input buffer’s last character.

RemoveInputBufferLastWord
Expand description

Remove input buffer’s last word.

ResetInputBuffer
Expand description

Reset the input buffer back to null. It will not show in the UI.

SwitchMode(String)
Expand description

Switch input mode.

NOTE: To be specific about which mode to switch to, use SwitchModeBuiltin or SwitchModeCustom instead.

Example: SwitchMode: default

SwitchModeBuiltin(String)
Expand description

Switch to a builtin mode.

Example: SwitchModeBuiltin: default

SwitchModeCustom(String)
Expand description

Switch to a custom mode.

Example: SwitchModeCustom: my_custom_mode

PopMode
Expand description

Pop the last mode from the history and switch to it.

SwitchLayout(String)
Expand description

Switch layout. This will call Refresh automatically.

NOTE: To be specific about which layout to switch to, use SwitchLayoutBuiltin or SwitchLayoutCustom instead.

Example: SwitchLayout: default

SwitchLayoutBuiltin(String)
Expand description

Switch to a builtin layout. This will call Refresh automatically.

Example: SwitchLayoutBuiltin: default

SwitchLayoutCustom(String)
Expand description

Switch to a custom layout. This will call Refresh automatically.

Example: SwitchLayoutCustom: my_custom_layout

Call(Command)
Expand description

Call a shell command with the given arguments. Note that the arguments will be shell-escaped. So to read the variables, the -c option of the shell can be used. You may need to pass Refresh or Explore depening on the expectation.

Example: Call: {command: bash, args: ["-c", "read -p test"]}

CallSilently(Command)
Expand description

Like Call but without the flicker. The stdin, stdout stderr will be piped to null. So it’s non-interactive.

Example: CallSilently: {command: tput, args: ["bell"]}

BashExec(String)
Expand description

An alias to Call: {command: bash, args: ["-c", "${command}"], silent: false} where ${command} is the given value.

Example: BashExec: "read -p test"

BashExecSilently(String)
Expand description

Like BashExec but without the flicker. The stdin, stdout stderr will be piped to null. So it’s non-interactive.

Example: BashExecSilently: "tput bell"

Select
Expand description

Select the focused node.

SelectAll
Expand description

Select all the visible nodes.

SelectPath(String)
Expand description

Select the given path.

Example: SelectPath: "/tmp"

UnSelect
Expand description

Unselect the focused node.

UnSelectAll
Expand description

Unselect all the visible nodes.

UnSelectPath(String)
Expand description

UnSelect the given path.

Example: UnSelectPath: "/tmp"

ToggleSelection
Expand description

Toggle selection on the focused node.

ToggleSelectAll
Expand description

Toggle between select all and unselect all.

ToggleSelectionByPath(String)
Expand description

Toggle selection by file path.

Example: ToggleSelectionByPath: "/tmp"

ClearSelection
Expand description

Clear the selection.

AddNodeFilter(NodeFilterApplicable)
Expand description

Add a filter to exclude nodes while exploring directories.

Example: AddNodeFilter: {filter: RelativePathDoesStartWith, input: foo}

RemoveNodeFilter(NodeFilterApplicable)
Expand description

Remove an existing filter.

Example: RemoveNodeFilter: {filter: RelativePathDoesStartWith, input: foo}

ToggleNodeFilter(NodeFilterApplicable)
Expand description

Remove a filter if it exists, else, add a it.

Example: ToggleNodeFilter: {filter: RelativePathDoesStartWith, input: foo}

AddNodeFilterFromInput(NodeFilter)
Expand description

Add a node filter reading the input from the buffer.

Example: AddNodeFilterFromInput: RelativePathDoesStartWith

RemoveNodeFilterFromInput(NodeFilter)
Expand description

Remove a node filter reading the input from the buffer.

Example: RemoveNodeFilterFromInput: RelativePathDoesStartWith

RemoveLastNodeFilter
Expand description

Remove the last node filter.

ResetNodeFilters
Expand description

Reset the node filters back to the default configuration.

ClearNodeFilters
Expand description

Clear all the node filters.

AddNodeSorter(NodeSorterApplicable)
Expand description

Add a sorter to sort nodes while exploring directories.

Example: AddNodeSorter: {sorter: ByRelativePath, reverse: false}

RemoveNodeSorter(NodeSorter)
Expand description

Remove an existing sorter.

Example: RemoveNodeSorter: ByRelativePath

ReverseNodeSorter(NodeSorter)
Expand description

Reverse a node sorter.

Example: ReverseNodeSorter: ByRelativePath

ToggleNodeSorter(NodeSorterApplicable)
Expand description

Remove a sorter if it exists, else, add a it.

Example: ToggleSorterSorter: {sorter: ByRelativePath, reverse: false}

ReverseNodeSorters
Expand description

Reverse the node sorters.

RemoveLastNodeSorter
Expand description

Remove the last node sorter.

ResetNodeSorters
Expand description

Reset the node sorters back to the default configuration.

ClearNodeSorters
Expand description

Clear all the node sorters.

LogInfo(String)
Expand description

Log information message.

Example: LogInfo: launching satellite

LogSuccess(String)
Expand description

Log a success message.

Example: LogSuccess: satellite reached destination.

LogWarning(String)
Expand description

Log an warning message.

Example: LogWarning: satellite is heating

LogError(String)
Expand description

Log an error message.

Example: LogError: satellite crashed

Quit
Expand description

Quit with returncode zero (success).

PrintResultAndQuit
Expand description

Print selected paths if it’s not empty, else, print the focused node’s path.

PrintAppStateAndQuit
Expand description

Print the state of application in YAML format. Helpful for debugging or generating the default configuration file.

Debug(String)
Expand description

Write the application state to a file, without quitting. Also helpful for debugging.

Terminate
Expand description

Terminate the application with a non-zero return code.

Implementations

impl ExternalMsg[src]

pub fn is_read_only(&self) -> bool[src]

Trait Implementations

impl Clone for ExternalMsg[src]

fn clone(&self) -> ExternalMsg[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ExternalMsg[src]

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

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for ExternalMsg[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<ExternalMsg> for ExternalMsg[src]

fn eq(&self, other: &ExternalMsg) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &ExternalMsg) -> bool[src]

This method tests for !=.

impl Serialize for ExternalMsg[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Eq for ExternalMsg[src]

impl StructuralEq for ExternalMsg[src]

impl StructuralPartialEq for ExternalMsg[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

Compare self to key and return true if they are equal.

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]