Struct tmux_interface::commands::miscellaneous::if_shell::IfShell
source · pub struct IfShell<'a> {
pub background: bool,
pub not_execute: bool,
pub target_pane: Option<Cow<'a, str>>,
pub shell_command: Option<Cow<'a, str>>,
pub command: Option<Cow<'a, str>>,
}
Expand description
Structure for conditional commands executing
§Manual
tmux ^2.0:
if-shell [-bF] [-t target-pane] shell-command command [command]
(alias: if)
tmux ^1.8:
if-shell [-b] [-t target-pane] shell-command command [command]
(alias: if)
tmux ^1.6:
if-shell shell-command command [command]
(alias: if)
tmux ^0.8:
if-shell shell-command command
(alias: if)
Fields§
§background: bool
[-b]
- run in the background
not_execute: bool
[-F]
not execute but considered success if neither empty nor zero
target_pane: Option<Cow<'a, str>>
[-t target-pane]
specify the target-pane
shell_command: Option<Cow<'a, str>>
[shell-command]
command: Option<Cow<'a, str>>
[command]
- specify the second command
Implementations§
source§impl<'a> IfShell<'a>
impl<'a> IfShell<'a>
pub fn new() -> Self
sourcepub fn background(self) -> Self
pub fn background(self) -> Self
[-b]
- run in the background
sourcepub fn not_execute(self) -> Self
pub fn not_execute(self) -> Self
[-F]
not execute but considered success if neither empty nor zero
sourcepub fn target_pane<S: Into<Cow<'a, str>>>(self, target_pane: S) -> Self
pub fn target_pane<S: Into<Cow<'a, str>>>(self, target_pane: S) -> Self
[-t target-pane]
specify the target-pane
sourcepub fn shell_command<S: Into<Cow<'a, str>>>(self, shell_command: S) -> Self
pub fn shell_command<S: Into<Cow<'a, str>>>(self, shell_command: S) -> Self
[shell-command]
sourcepub fn command<S: Into<Cow<'a, str>>>(self, command: S) -> Self
pub fn command<S: Into<Cow<'a, str>>>(self, command: S) -> Self
[command]
- specify the second command
pub fn build(self) -> TmuxCommand<'a>
Trait Implementations§
source§impl<'a> From<IfShell<'a>> for TmuxCommand<'a>
impl<'a> From<IfShell<'a>> for TmuxCommand<'a>
source§impl<'a> Ord for IfShell<'a>
impl<'a> Ord for IfShell<'a>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a> PartialEq for IfShell<'a>
impl<'a> PartialEq for IfShell<'a>
source§impl<'a> PartialOrd for IfShell<'a>
impl<'a> PartialOrd for IfShell<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Eq for IfShell<'a>
impl<'a> StructuralPartialEq for IfShell<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for IfShell<'a>
impl<'a> Send for IfShell<'a>
impl<'a> Sync for IfShell<'a>
impl<'a> Unpin for IfShell<'a>
impl<'a> UnwindSafe for IfShell<'a>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more