SessionConfig

Struct SessionConfig 

Source
pub struct SessionConfig {
    pub command: String,
    pub args: Vec<String>,
    pub env: HashMap<String, String>,
    pub inherit_env: bool,
    pub working_dir: Option<PathBuf>,
    pub dimensions: (u16, u16),
    pub timeout: TimeoutConfig,
    pub buffer: BufferConfig,
    pub logging: LoggingConfig,
    pub line_ending: LineEnding,
    pub encoding: EncodingConfig,
    pub delay_before_send: Duration,
}
Expand description

Configuration for a session.

Fields§

§command: String

The command to execute.

§args: Vec<String>

Command arguments.

§env: HashMap<String, String>

Environment variables to set.

§inherit_env: bool

Whether to inherit the parent environment.

§working_dir: Option<PathBuf>

Working directory for the process.

§dimensions: (u16, u16)

Terminal dimensions (width, height).

§timeout: TimeoutConfig

Timeout configuration.

§buffer: BufferConfig

Buffer configuration.

§logging: LoggingConfig

Logging configuration.

§line_ending: LineEnding

Line ending configuration.

§encoding: EncodingConfig

Encoding configuration.

§delay_before_send: Duration

Delay before send operations.

Implementations§

Source§

impl SessionConfig

Source

pub fn new(command: impl Into<String>) -> Self

Create a new session configuration with the given command.

Source

pub fn args<I, S>(self, args: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Set the command arguments.

Source

pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self

Add an environment variable.

Source

pub const fn inherit_env(self, inherit: bool) -> Self

Set whether to inherit the parent environment.

Source

pub fn working_dir(self, path: impl Into<PathBuf>) -> Self

Set the working directory.

Source

pub const fn dimensions(self, width: u16, height: u16) -> Self

Set the terminal dimensions.

Source

pub const fn timeout(self, timeout: Duration) -> Self

Set the default timeout.

Source

pub const fn line_ending(self, line_ending: LineEnding) -> Self

Set the line ending style.

Source

pub const fn delay_before_send(self, delay: Duration) -> Self

Set the delay before send operations.

Trait Implementations§

Source§

impl Clone for SessionConfig

Source§

fn clone(&self) -> SessionConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionConfig

Source§

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

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

impl Default for SessionConfig

Source§

fn default() -> Self

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

impl From<&SessionConfig> for PtyConfig

Source§

fn from(config: &SessionConfig) -> Self

Converts to this type from the input type.
Source§

impl From<SessionBuilder> for SessionConfig

Source§

fn from(builder: SessionBuilder) -> Self

Converts to this type from the input type.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V