Skip to main content

AttachHeader

Struct AttachHeader 

Source
pub struct AttachHeader {
    pub name: String,
    pub local_tty_size: TtySize,
    pub local_env: Vec<(String, String)>,
    pub ttl_secs: Option<u64>,
    pub cmd: Option<String>,
    pub dir: Option<String>,
    pub start_cmd: Option<String>,
}
Expand description

AttachHeader is the blob of metadata that a client transmits when it first dials into the shpool daemon indicating which shell it wants to attach to.

Fields§

§name: String

The name of the session to create or attach to.

§local_tty_size: TtySize

The size of the local tty. Passed along so that the remote pty can be kept in sync (important so curses applications look right).

§local_env: Vec<(String, String)>

A subset of the environment of the shell that shpool attach is run in. Contains only some variables needed to set up the shell when shpool forks off a process. For now the list is just SSH_AUTH_SOCK and TERM.

§ttl_secs: Option<u64>

If specified, sets a time limit on how long the shell will be open when the shell is first created (does nothing in the case of a reattach). The daemon is responsible for automatically killing the session once the ttl is over.

§cmd: Option<String>

If specified, a command to run instead of the users default shell.

§dir: Option<String>

If specified, the directory to start the shell in. If not, $HOME should be used.

§start_cmd: Option<String>

If specified, shpool will inject the given command into the shell when it first starts up. This option is ignored for reattaches. Note that this differs from the cmd option in that it is run directly in the shell rather than replacing the shell. Think of it as running source cmd rather than exec cmd. The main usecase is to be able to automatically enter some useful context such as a particular directory with a python virtual environment already set up for example.

Implementations§

Source§

impl AttachHeader

Source

pub fn local_env_get(&self, var: &str) -> Option<&str>

Trait Implementations§

Source§

impl Debug for AttachHeader

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for AttachHeader

Source§

fn default() -> AttachHeader

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AttachHeader

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AttachHeader

Source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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