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

pub enum ExternalMsg {
Show variants Explore, 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), 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), LogError(String), Quit, PrintResultAndQuit, PrintAppStateAndQuit, Debug(String), Terminate,
}

Variants

Explore

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

Refresh

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

Clears the screen.

FocusNext

Focus next node.

FocusNextByRelativeIndex(usize)

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

Example: FocusNextByRelativeIndex: 2

FocusNextByRelativeIndexFromInput

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

FocusPrevious

Focus on the previous item.

FocusPreviousByRelativeIndex(usize)

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

Example: FocusPreviousByRelativeIndex: 2

FocusPreviousByRelativeIndexFromInput

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

FocusFirst

Focus on the first node.

FocusLast

Focus on the last node.

FocusPath(String)

Focus on the given path.

Example: FocusPath: /tmp

FocusPathFromInput

Focus on the path read from input buffer.

FocusByIndex(usize)

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

Example: FocusByIndex: 2

FocusByIndexFromInput

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

FocusByFileName(String)

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

Example: FocusByFileName: README.md

ChangeDirectory(String)

Change the present working directory ($PWD)

Example: ChangeDirectory: /tmp

Enter

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

Back

Go back to the parent directory.

LastVisitedPath

Go to the last path visited.

NextVisitedPath

Go to the next path visited.

Follow the symlink under focus to its actual location.

BufferInput(String)

Append/buffer the given string into the input buffer.

Example: BufferInput: foo

BufferInputFromKey

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

SetInputBuffer(String)

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

Remove input buffer’s last character.

RemoveInputBufferLastWord

Remove input buffer’s last word.

ResetInputBuffer

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

SwitchMode(String)

Switch input mode. This will reset the input buffer and call Refresh automatically.

Example: SwitchMode: default

Call(Command)

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)

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)

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

Example: BashExec: "read -p test"

BashExecSilently(String)

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

Select the focused node.

SelectAll

Select all the visible nodes.

SelectPath(String)

Select the given path.

Example: SelectPath: "/tmp"

UnSelect

Unselect the focused node.

UnSelectAll

Unselect all the visible nodes.

UnSelectPath(String)

UnSelect the given path.

Example: UnSelectPath: "/tmp"

ToggleSelection

Toggle selection on the focused node.

ToggleSelectAll

Toggle between select all and unselect all.

ToggleSelectionByPath(String)

Toggle selection by file path.

Example: ToggleSelectionByPath: "/tmp"

ClearSelection

Clear the selection.

AddNodeFilter(NodeFilterApplicable)

Add a filter to exclude nodes while exploring directories.

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

RemoveNodeFilter(NodeFilterApplicable)

Remove an existing filter.

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

ToggleNodeFilter(NodeFilterApplicable)

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

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

AddNodeFilterFromInput(NodeFilter)

Add a node filter reading the input from the buffer.

Example: AddNodeFilterFromInput: RelativePathDoesStartWith

RemoveNodeFilterFromInput(NodeFilter)

Remove a node filter reading the input from the buffer.

Example: RemoveNodeFilterFromInput: RelativePathDoesStartWith

RemoveLastNodeFilter

Remove the last node filter.

ResetNodeFilters

Reset the node filters back to the default configuration.

ClearNodeFilters

Clear all the node filters.

AddNodeSorter(NodeSorterApplicable)

Add a sorter to sort nodes while exploring directories.

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

RemoveNodeSorter(NodeSorter)

Remove an existing sorter.

Example: RemoveNodeSorter: ByRelativePath

ReverseNodeSorter(NodeSorter)

Reverse a node sorter.

Example: ReverseNodeSorter: ByRelativePath

ToggleNodeSorter(NodeSorterApplicable)

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

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

ReverseNodeSorters

Reverse the node sorters.

RemoveLastNodeSorter

Remove the last node sorter.

ResetNodeSorters

Reset the node sorters back to the default configuration.

ClearNodeSorters

Clear all the node sorters.

LogInfo(String)

Log information message.

Example: LogInfo: launching satellite

LogSuccess(String)

Log a success message.

Example: LogSuccess: satellite reached destination.

LogError(String)

Log an error message.

Example: LogError: satellite crashed

Quit

Quit with returncode zero (success).

PrintResultAndQuit

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

PrintAppStateAndQuit

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

Debug(String)

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

Terminate

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]

impl Debug for ExternalMsg[src]

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

impl Eq for ExternalMsg[src]

impl PartialEq<ExternalMsg> for ExternalMsg[src]

impl Serialize 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]

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

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.