pub struct PtyConfig {
pub cols: u16,
pub rows: u16,
pub term: Option<String>,
pub env: Vec<(String, String)>,
pub test_name: Option<String>,
pub log_events: bool,
pub input_write_timeout: Duration,
}Expand description
Configuration for PTY-backed test sessions.
Fields§
§cols: u16PTY width in columns.
rows: u16PTY height in rows.
term: Option<String>TERM to set in the child (defaults to xterm-256color).
env: Vec<(String, String)>Extra environment variables to set in the child.
test_name: Option<String>Optional test name for logging context.
log_events: boolEnable structured PTY logging to stderr.
input_write_timeout: DurationMaximum time to wait for PTY input writes before failing.
Implementations§
Source§impl PtyConfig
impl PtyConfig
Sourcepub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add an environment variable in the child.
Sourcepub fn with_test_name(self, name: impl Into<String>) -> Self
pub fn with_test_name(self, name: impl Into<String>) -> Self
Attach a test name for logging context.
Sourcepub fn with_input_write_timeout(self, timeout: Duration) -> Self
pub fn with_input_write_timeout(self, timeout: Duration) -> Self
Override the PTY input write timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PtyConfig
impl RefUnwindSafe for PtyConfig
impl Send for PtyConfig
impl Sync for PtyConfig
impl Unpin for PtyConfig
impl UnsafeUnpin for PtyConfig
impl UnwindSafe for PtyConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.