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: StringThe command to execute.
args: Vec<String>Command arguments.
env: HashMap<String, String>Environment variables to set.
inherit_env: boolWhether to inherit the parent environment.
working_dir: Option<PathBuf>Working directory for the process.
dimensions: (u16, u16)Terminal dimensions (width, height).
timeout: TimeoutConfigTimeout configuration.
buffer: BufferConfigBuffer configuration.
logging: LoggingConfigLogging configuration.
line_ending: LineEndingLine ending configuration.
encoding: EncodingConfigEncoding configuration.
delay_before_send: DurationDelay before send operations.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn new(command: impl Into<String>) -> Self
pub fn new(command: impl Into<String>) -> Self
Create a new session configuration with the given command.
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an environment variable.
Sourcepub const fn inherit_env(self, inherit: bool) -> Self
pub const fn inherit_env(self, inherit: bool) -> Self
Set whether to inherit the parent environment.
Sourcepub fn working_dir(self, path: impl Into<PathBuf>) -> Self
pub fn working_dir(self, path: impl Into<PathBuf>) -> Self
Set the working directory.
Sourcepub const fn dimensions(self, width: u16, height: u16) -> Self
pub const fn dimensions(self, width: u16, height: u16) -> Self
Set the terminal dimensions.
Sourcepub const fn line_ending(self, line_ending: LineEnding) -> Self
pub const fn line_ending(self, line_ending: LineEnding) -> Self
Set the line ending style.
Sourcepub const fn delay_before_send(self, delay: Duration) -> Self
pub const fn delay_before_send(self, delay: Duration) -> Self
Set the delay before send operations.
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
Returns a duplicate 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 Debug for SessionConfig
impl Debug for SessionConfig
Source§impl Default for SessionConfig
impl Default for SessionConfig
Source§impl From<&SessionConfig> for PtyConfig
impl From<&SessionConfig> for PtyConfig
Source§fn from(config: &SessionConfig) -> Self
fn from(config: &SessionConfig) -> Self
Converts to this type from the input type.
Source§impl From<SessionBuilder> for SessionConfig
impl From<SessionBuilder> for SessionConfig
Source§fn from(builder: SessionBuilder) -> Self
fn from(builder: SessionBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnwindSafe for SessionConfig
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