pub struct ShellState {
pub env: HashMap<String, String>,
pub variables: HashMap<String, String>,
pub arrays: HashMap<String, HashMap<usize, String>>,
pub assoc_arrays: HashMap<String, HashMap<String, String>>,
pub cwd: PathBuf,
pub last_exit_code: i32,
pub aliases: HashMap<String, String>,
pub traps: HashMap<String, String>,
pub errexit: bool,
pub xtrace: bool,
pub pipefail: bool,
}Expand description
A snapshot of shell state (variables, env, cwd, options).
Captures the serializable portions of the interpreter state.
Combined with VfsSnapshot this provides
full session snapshot/restore.
Fields§
§env: HashMap<String, String>Environment variables
variables: HashMap<String, String>Shell variables
arrays: HashMap<String, HashMap<usize, String>>Indexed arrays
assoc_arrays: HashMap<String, HashMap<String, String>>Associative arrays
cwd: PathBufCurrent working directory
last_exit_code: i32Last exit code
aliases: HashMap<String, String>Shell aliases
traps: HashMap<String, String>Trap handlers
errexit: boolShell options
xtrace: boolShell options
pipefail: boolShell options
Trait Implementations§
Source§impl Clone for ShellState
impl Clone for ShellState
Source§fn clone(&self) -> ShellState
fn clone(&self) -> ShellState
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 ShellState
impl Debug for ShellState
Source§impl<'de> Deserialize<'de> for ShellState
impl<'de> Deserialize<'de> for ShellState
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ShellState
impl RefUnwindSafe for ShellState
impl Send for ShellState
impl Sync for ShellState
impl Unpin for ShellState
impl UnsafeUnpin for ShellState
impl UnwindSafe for ShellState
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