pub struct Command {
pub side: Option<PanelSide>,
pub roots: Vec<PathBuf>,
pub reveal: Vec<PathBuf>,
pub hidden: bool,
pub width: Option<WidthArg>,
}Expand description
What a tree-space invocation wants the panel to do.
Fields§
§side: Option<PanelSide>An explicit --side override. Absent means “use the configured side”.
roots: Vec<PathBuf>Directory roots to open as panes. Empty means this is a show/toggle.
reveal: Vec<PathBuf>Files (or paths) to reveal: each opens a pane rooted at its containing
directory and selects the path once the pane is loaded. Populated by
--select PATH and by positional arguments that name a non-directory.
--hidden: do everything else as usual, but ensure the panel ends up
hidden — hide it if showing, leave it hidden if already hidden, and
start hidden when this launches the panel.
width: Option<WidthArg>--width: resize the panel (absolute or relative) without touching its
visibility.
Implementations§
Source§impl Command
impl Command
Sourcepub fn parse<I, S>(args: I) -> Self
pub fn parse<I, S>(args: I) -> Self
Parse the arguments of a tree-space invocation (everything after
argv[0], as OsStrings). Only arguments that are existing directories
become roots; --side left|right (or --side=left|right) selects the
side override. Unknown flags are ignored for forward compatibility.
Sourcepub fn encode(&self) -> String
pub fn encode(&self) -> String
Encode into the IPC wire format (a single line, NUL-separated tokens).
Sourcepub fn decode(line: &str) -> Option<Command>
pub fn decode(line: &str) -> Option<Command>
Decode a line from the IPC wire format back into a Command. An empty
(or whitespace-only) line decodes to a plain toggle.
Sourcepub fn is_toggle(&self) -> bool
pub fn is_toggle(&self) -> bool
Does this command carry no directories and ask for the normal toggle
(neither a side override, --hidden, nor --width)?
Sourcepub fn reveal_targets(&self) -> Vec<(PathBuf, Option<PathBuf>)>
pub fn reveal_targets(&self) -> Vec<(PathBuf, Option<PathBuf>)>
Resolve each reveal path into a pane root plus an optional child to
select. A directory (or the current directory .) opens as its own
root with nothing to select; a file opens a pane rooted at its parent
directory and selects the file. A path with no parent component (e.g.
/) is skipped.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<C> AsyncPosition<()> for C
impl<C> AsyncPosition<()> for C
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> 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 more