pub struct PtySpawnConfig {
pub program: Option<PathBuf>,
pub args: Vec<String>,
pub cwd: Option<PathBuf>,
pub env: Vec<(String, String)>,
pub term: String,
pub size: PtySize,
}Expand description
Backend-neutral child process and PTY spawn configuration.
Values are not validated. For the portable backend, program == None selects
the library’s platform-default program and ignores args; an explicit program
receives arguments in order. cwd and environment entries are passed to the
backend. The portable backend sets TERM from term first and then applies
env, so a later ("TERM", value) entry can override it; duplicate-variable
behavior otherwise follows the backend/OS.
§Examples
use std::path::PathBuf;
use ailloli_ui_terminal_pty::{PtySize, PtySpawnConfig};
let config = PtySpawnConfig {
program: Some(PathBuf::from("sh")),
args: vec!["-lc".into(), "printf ok".into()],
size: PtySize::new(30, 100, 0, 0),
..PtySpawnConfig::default()
};
assert_eq!(config.args.len(), 2);Fields§
§program: Option<PathBuf>Explicit program path/name, or None for the backend default.
args: Vec<String>Ordered arguments used only with an explicit program by the portable backend.
cwd: Option<PathBuf>Child working directory, or None to inherit backend behavior.
env: Vec<(String, String)>Ordered environment overrides; names/values may be empty or duplicated.
term: StringRequested TERM value; stored/passed verbatim and empty is accepted.
size: PtySizeInitial PTY grid and pixel dimensions.
Trait Implementations§
Source§impl Clone for PtySpawnConfig
impl Clone for PtySpawnConfig
Source§fn clone(&self) -> PtySpawnConfig
fn clone(&self) -> PtySpawnConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PtySpawnConfig
impl Debug for PtySpawnConfig
Source§impl Default for PtySpawnConfig
impl Default for PtySpawnConfig
Source§impl<'de> Deserialize<'de> for PtySpawnConfig
impl<'de> Deserialize<'de> for PtySpawnConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PtySpawnConfig
impl PartialEq for PtySpawnConfig
Source§impl Serialize for PtySpawnConfig
impl Serialize for PtySpawnConfig
impl Eq for PtySpawnConfig
impl StructuralPartialEq for PtySpawnConfig
Auto Trait Implementations§
impl Freeze for PtySpawnConfig
impl RefUnwindSafe for PtySpawnConfig
impl Send for PtySpawnConfig
impl Sync for PtySpawnConfig
impl Unpin for PtySpawnConfig
impl UnwindSafe for PtySpawnConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.