SessionBuilder

Struct SessionBuilder 

Source
pub struct SessionBuilder { /* private fields */ }
Expand description

Builder for creating session configurations.

Implementations§

Source§

impl SessionBuilder

Source

pub fn new() -> Self

Create a new session builder with default configuration.

Source

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

Set the command to execute.

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 arg(self, arg: impl Into<String>) -> Self

Add a single argument.

Source

pub fn envs<I, K, V>(self, envs: I) -> Self
where I: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Set environment variables.

Source

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

Set a single environment variable.

Source

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

Set the working directory.

Source

pub const fn dimensions(self, cols: u16, rows: u16) -> Self

Set the terminal dimensions (width, height).

Source

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

Set the default timeout.

Source

pub const fn timeout_config(self, config: TimeoutConfig) -> Self

Set the timeout configuration.

Source

pub const fn buffer_max_size(self, max_size: usize) -> Self

Set the buffer max size.

Source

pub const fn buffer_config(self, config: BufferConfig) -> Self

Set the buffer configuration.

Source

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

Set the line ending style.

Source

pub const fn unix_line_endings(self) -> Self

Use Unix line endings (LF).

Source

pub const fn windows_line_endings(self) -> Self

Use Windows line endings (CRLF).

Source

pub const fn encoding(self, config: EncodingConfig) -> Self

Set the encoding configuration.

Source

pub fn logging(self, config: LoggingConfig) -> Self

Set the logging configuration.

Source

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

Enable logging to a file.

Source

pub fn build(self) -> SessionConfig

Build the session configuration.

Trait Implementations§

Source§

impl Clone for SessionBuilder

Source§

fn clone(&self) -> SessionBuilder

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 SessionBuilder

Source§

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

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

impl Default for SessionBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
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