Struct tmux_interface::commands::global_and_session_environment::set_environment::SetEnvironment
source · pub struct SetEnvironment<'a> {
pub expand: bool,
pub hidden: bool,
pub global: bool,
pub remove: bool,
pub unset: bool,
pub target_session: Option<Cow<'a, str>>,
pub name: Option<Cow<'a, str>>,
pub value: Option<Cow<'a, str>>,
}
Expand description
Structure for setting or unsetting an environment variable
§Manual
tmux ^3.2:
set-environment [-Fhgru] [-t target-session] name [value]
(alias: setenv)
tmux ^1.0:
set-environment [-gru] [-t target-session] name [value]
(alias: setenv)
Fields§
§expand: bool
[-F]
- value is expanded as a format
[-h]
- marks the variable as hidden
global: bool
[-g]
- make change in the global environment
remove: bool
[-r]
- remove the variable from the environment before starting a new process
unset: bool
[-u]
- unset a variable
target_session: Option<Cow<'a, str>>
[-t target-session]
- target-session
name: Option<Cow<'a, str>>
name
value: Option<Cow<'a, str>>
[value]
- specify the value
Implementations§
source§impl<'a> SetEnvironment<'a>
impl<'a> SetEnvironment<'a>
pub fn new() -> Self
[-h]
- marks the variable as hidden
sourcepub fn remove(self) -> Self
pub fn remove(self) -> Self
[-r]
- remove the variable from the environment before starting a new process
sourcepub fn target_session<S: Into<Cow<'a, str>>>(self, target_session: S) -> Self
pub fn target_session<S: Into<Cow<'a, str>>>(self, target_session: S) -> Self
[-t target-session]
- target-session
pub fn build(self) -> TmuxCommand<'a>
Trait Implementations§
source§impl<'a> Clone for SetEnvironment<'a>
impl<'a> Clone for SetEnvironment<'a>
source§fn clone(&self) -> SetEnvironment<'a>
fn clone(&self) -> SetEnvironment<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for SetEnvironment<'a>
impl<'a> Debug for SetEnvironment<'a>
source§impl<'a> Default for SetEnvironment<'a>
impl<'a> Default for SetEnvironment<'a>
source§fn default() -> SetEnvironment<'a>
fn default() -> SetEnvironment<'a>
Returns the “default value” for a type. Read more
source§impl<'a> From<SetEnvironment<'a>> for TmuxCommand<'a>
impl<'a> From<SetEnvironment<'a>> for TmuxCommand<'a>
source§fn from(item: SetEnvironment<'a>) -> Self
fn from(item: SetEnvironment<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> Hash for SetEnvironment<'a>
impl<'a> Hash for SetEnvironment<'a>
source§impl<'a> Ord for SetEnvironment<'a>
impl<'a> Ord for SetEnvironment<'a>
source§fn cmp(&self, other: &SetEnvironment<'a>) -> Ordering
fn cmp(&self, other: &SetEnvironment<'a>) -> Ordering
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 SetEnvironment<'a>
impl<'a> PartialEq for SetEnvironment<'a>
source§fn eq(&self, other: &SetEnvironment<'a>) -> bool
fn eq(&self, other: &SetEnvironment<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'a> PartialOrd for SetEnvironment<'a>
impl<'a> PartialOrd for SetEnvironment<'a>
source§fn partial_cmp(&self, other: &SetEnvironment<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &SetEnvironment<'a>) -> Option<Ordering>
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 SetEnvironment<'a>
impl<'a> StructuralPartialEq for SetEnvironment<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for SetEnvironment<'a>
impl<'a> Send for SetEnvironment<'a>
impl<'a> Sync for SetEnvironment<'a>
impl<'a> Unpin for SetEnvironment<'a>
impl<'a> UnwindSafe for SetEnvironment<'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