pub struct SessionBuilder { /* private fields */ }Expand description
Builder for creating session configurations.
Implementations§
Source§impl SessionBuilder
impl SessionBuilder
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
Set a single environment variable.
Sourcepub fn working_directory(self, path: impl Into<PathBuf>) -> Self
pub fn working_directory(self, path: impl Into<PathBuf>) -> Self
Set the working directory.
Sourcepub const fn dimensions(self, cols: u16, rows: u16) -> Self
pub const fn dimensions(self, cols: u16, rows: u16) -> Self
Set the terminal dimensions (width, height).
Sourcepub const fn timeout_config(self, config: TimeoutConfig) -> Self
pub const fn timeout_config(self, config: TimeoutConfig) -> Self
Set the timeout configuration.
Sourcepub const fn buffer_max_size(self, max_size: usize) -> Self
pub const fn buffer_max_size(self, max_size: usize) -> Self
Set the buffer max size.
Sourcepub const fn buffer_config(self, config: BufferConfig) -> Self
pub const fn buffer_config(self, config: BufferConfig) -> Self
Set the buffer configuration.
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 unix_line_endings(self) -> Self
pub const fn unix_line_endings(self) -> Self
Use Unix line endings (LF).
Sourcepub const fn windows_line_endings(self) -> Self
pub const fn windows_line_endings(self) -> Self
Use the Windows line ending for sending: CR.
This is deliberately Cr and not CrLf. Like its
unix_line_endings sibling — which sets Lf, the
Unix ENTER — this selects the terminator the platform’s terminal sends for the
ENTER key, not the platform’s text-file convention. \r is what Windows
Terminal sends to ConPTY for ENTER.
CrLf also submits a line today, but only because conhost swallows the
trailing LF; against a child with ENABLE_LINE_INPUT disabled an LF that did
arrive would submit a second ENTER. To normalize text to CRLF, use
LineEndingStyle instead — that is a
separate concern from the send terminator.
Sourcepub const fn encoding(self, config: EncodingConfig) -> Self
pub const fn encoding(self, config: EncodingConfig) -> Self
Set the encoding configuration.
Sourcepub fn logging(self, config: LoggingConfig) -> Self
pub fn logging(self, config: LoggingConfig) -> Self
Set the logging configuration.
Sourcepub fn log_to_file(self, path: impl Into<PathBuf>) -> Self
pub fn log_to_file(self, path: impl Into<PathBuf>) -> Self
Enable logging to a file.
Sourcepub fn build(self) -> SessionConfig
pub fn build(self) -> SessionConfig
Build the session configuration.
Trait Implementations§
Source§impl Clone for SessionBuilder
impl Clone for SessionBuilder
Source§fn clone(&self) -> SessionBuilder
fn clone(&self) -> SessionBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more