pub struct ShellExecutor {Show 57 fields
pub functions: HashMap<String, ShellCommand>,
pub aliases: HashMap<String, String>,
pub global_aliases: HashMap<String, String>,
pub suffix_aliases: HashMap<String, String>,
pub last_status: i32,
pub variables: HashMap<String, String>,
pub arrays: HashMap<String, Vec<String>>,
pub assoc_arrays: HashMap<String, HashMap<String, String>>,
pub jobs: JobTable,
pub fpath: Vec<PathBuf>,
pub zwc_cache: HashMap<PathBuf, ZwcFile>,
pub positional_params: Vec<String>,
pub history: Option<HistoryEngine>,
pub traps: HashMap<String, String>,
pub options: HashMap<String, bool>,
pub completions: HashMap<String, CompSpec>,
pub dir_stack: Vec<PathBuf>,
pub comp_matches: Vec<CompMatch>,
pub comp_groups: Vec<CompGroup>,
pub comp_state: CompState,
pub zstyles: Vec<ZStyle>,
pub comp_words: Vec<String>,
pub comp_current: i32,
pub comp_prefix: String,
pub comp_suffix: String,
pub comp_iprefix: String,
pub comp_isuffix: String,
pub readonly_vars: HashSet<String>,
pub local_save_stack: Vec<(String, Option<String>)>,
pub local_scope_depth: usize,
pub autoload_pending: HashMap<String, AutoloadFlags>,
pub hook_functions: HashMap<String, Vec<String>>,
pub named_dirs: HashMap<String, PathBuf>,
pub zptys: HashMap<String, ZptyState>,
pub open_fds: HashMap<i32, File>,
pub next_fd: i32,
pub scheduled_commands: Vec<ScheduledCommand>,
pub profile_data: HashMap<String, ProfileEntry>,
pub profiling_enabled: bool,
pub unix_sockets: HashMap<i32, UnixSocketState>,
pub compsys_cache: Option<CompsysCache>,
pub compinit_pending: Option<(Receiver<CompInitBgResult>, Instant)>,
pub plugin_cache: Option<PluginCache>,
pub deferred_compdefs: Vec<Vec<String>>,
pub command_hash: HashMap<String, String>,
pub pcre_state: PcreState,
pub tcp_sessions: TcpSessions,
pub zftp: Zftp,
pub profiler: Profiler,
pub style_table: StyleTable,
pub zsh_compat: bool,
pub posix_mode: bool,
pub worker_pool: Arc<WorkerPool>,
pub intercepts: Vec<Intercept>,
pub async_jobs: HashMap<u32, Receiver<(i32, String)>>,
pub next_async_id: u32,
pub defer_stack: Vec<Vec<String>>,
/* private fields */
}Fields§
§functions: HashMap<String, ShellCommand>§aliases: HashMap<String, String>§global_aliases: HashMap<String, String>§suffix_aliases: HashMap<String, String>§last_status: i32§variables: HashMap<String, String>§arrays: HashMap<String, Vec<String>>§assoc_arrays: HashMap<String, HashMap<String, String>>§jobs: JobTable§fpath: Vec<PathBuf>§zwc_cache: HashMap<PathBuf, ZwcFile>§positional_params: Vec<String>§history: Option<HistoryEngine>§traps: HashMap<String, String>§options: HashMap<String, bool>§completions: HashMap<String, CompSpec>§dir_stack: Vec<PathBuf>§comp_matches: Vec<CompMatch>§comp_groups: Vec<CompGroup>§comp_state: CompState§zstyles: Vec<ZStyle>§comp_words: Vec<String>§comp_current: i32§comp_prefix: String§comp_suffix: String§comp_iprefix: String§comp_isuffix: String§readonly_vars: HashSet<String>§local_save_stack: Vec<(String, Option<String>)>Stack for local variable save/restore (name, old_value).
local_scope_depth: usizeCurrent function scope depth for local tracking.
autoload_pending: HashMap<String, AutoloadFlags>§hook_functions: HashMap<String, Vec<String>>§named_dirs: HashMap<String, PathBuf>§zptys: HashMap<String, ZptyState>§open_fds: HashMap<i32, File>§next_fd: i32§scheduled_commands: Vec<ScheduledCommand>§profile_data: HashMap<String, ProfileEntry>§profiling_enabled: bool§unix_sockets: HashMap<i32, UnixSocketState>§compsys_cache: Option<CompsysCache>§compinit_pending: Option<(Receiver<CompInitBgResult>, Instant)>§plugin_cache: Option<PluginCache>§deferred_compdefs: Vec<Vec<String>>§command_hash: HashMap<String, String>§pcre_state: PcreState§tcp_sessions: TcpSessions§zftp: Zftp§profiler: Profiler§style_table: StyleTable§zsh_compat: boolzsh compatibility mode - use .zcompdump, fpath scanning, etc.
posix_mode: boolPOSIX sh strict mode — no SQLite, no worker pool, no zsh extensions
worker_pool: Arc<WorkerPool>Worker thread pool for background tasks (compinit, process subs, etc.)
intercepts: Vec<Intercept>AOP intercept table: command/function name → advice chain. Glob patterns supported (e.g. “git ”, “”).
async_jobs: HashMap<u32, Receiver<(i32, String)>>Async job handles: id → receiver for (status, stdout)
next_async_id: u32Next async job ID
defer_stack: Vec<Vec<String>>Defer stack: commands to run on scope exit (LIFO).
Implementations§
Source§impl ShellExecutor
impl ShellExecutor
pub fn new() -> ShellExecutor
Sourcepub fn enter_posix_mode(&mut self)
pub fn enter_posix_mode(&mut self)
Enter POSIX strict mode — drop all SQLite caches, shrink worker pool to minimum. No zsh extensions, no caching, no threads beyond the bare minimum. Dinosaur mode.
Sourcepub fn add_named_dir(&mut self, name: &str, path: &str)
pub fn add_named_dir(&mut self, name: &str, path: &str)
Add a named directory (hash -d name=path)
Sourcepub fn expand_tilde_named(&self, path: &str) -> String
pub fn expand_tilde_named(&self, path: &str) -> String
Expand ~ with named directories
Sourcepub fn autoload_function(&mut self, name: &str) -> Option<ShellCommand>
pub fn autoload_function(&mut self, name: &str) -> Option<ShellCommand>
Try to load a function from ZWC files in fpath
Sourcepub fn glob_match_static(s: &str, pattern: &str) -> bool
pub fn glob_match_static(s: &str, pattern: &str) -> bool
Static glob match — same logic as glob_match but callable without &self, needed for Rayon parallel iterators that can’t capture &self.
Sourcepub fn execute_script_file(&mut self, file_path: &str) -> Result<i32, String>
pub fn execute_script_file(&mut self, file_path: &str) -> Result<i32, String>
Execute a script file with bytecode caching — skips lex+parse+compile on cache hit. The AST is stored in SQLite keyed by (path, mtime).
pub fn execute_script(&mut self, script: &str) -> Result<i32, String>
pub fn execute_command(&mut self, cmd: &ShellCommand) -> Result<i32, String>
Sourcepub fn maybe_autoload(&mut self, name: &str) -> bool
pub fn maybe_autoload(&mut self, name: &str) -> bool
Check if a function is autoload pending and load it if so
Source§impl ShellExecutor
impl ShellExecutor
Sourcepub fn drain_compinit_bg(&mut self)
pub fn drain_compinit_bg(&mut self)
Non-blocking drain of background compinit results. Call this before any completion lookup (prompt, tab-complete, etc.). If the background thread hasn’t finished yet, this is a no-op.
Sourcepub fn zfork(&mut self, flags: ForkFlags) -> Result<ForkResult, Error>
pub fn zfork(&mut self, flags: ForkFlags) -> Result<ForkResult, Error>
Fork a new process Port of zfork() from exec.c
Sourcepub fn zexecve(&self, cmd: &str, args: &[String]) -> !
pub fn zexecve(&self, cmd: &str, args: &[String]) -> !
Execute a command in the current process (exec family) Port of zexecve() from exec.c
Sourcepub fn entersubsh(&mut self, flags: SubshellFlags)
pub fn entersubsh(&mut self, flags: SubshellFlags)
Enter a subshell Port of entersubsh() from exec.c
Sourcepub fn doshfunc(
&mut self,
name: &str,
func: &ShellCommand,
args: &[String],
) -> Result<i32, String>
pub fn doshfunc( &mut self, name: &str, func: &ShellCommand, args: &[String], ) -> Result<i32, String>
Execute a shell function Port of doshfunc() from exec.c
Sourcepub fn execarith(&mut self, expr: &str) -> i32
pub fn execarith(&mut self, expr: &str) -> i32
Execute arithmetic expression Port of execarith() from exec.c
Sourcepub fn execcond(&mut self, cond: &CondExpr) -> i32
pub fn execcond(&mut self, cond: &CondExpr) -> i32
Execute conditional expression Port of execcond() from exec.c
Sourcepub fn exectime(&mut self, cmd: &ShellCommand) -> Result<i32, String>
pub fn exectime(&mut self, cmd: &ShellCommand) -> Result<i32, String>
Execute command and capture time Port of exectime() from exec.c
Sourcepub fn findcmd(&self, name: &str, do_hash: bool) -> Option<String>
pub fn findcmd(&self, name: &str, do_hash: bool) -> Option<String>
Find command in PATH Port of findcmd() from exec.c
Sourcepub fn hashcmd(&mut self, name: &str, path: &str)
pub fn hashcmd(&mut self, name: &str, path: &str)
Hash a command (add to command hash table) Port of hashcmd() from exec.c
Sourcepub fn iscom(&self, name: &str) -> bool
pub fn iscom(&self, name: &str) -> bool
Check if command exists and is executable Port of iscom() from exec.c
Sourcepub fn closem(&self, exceptions: &[i32])
pub fn closem(&self, exceptions: &[i32])
Close all file descriptors except stdin/stdout/stderr Port of closem() from exec.c
Sourcepub fn addfd(
&self,
fd: i32,
target_fd: i32,
mode: RedirMode,
) -> Result<(), Error>
pub fn addfd( &self, fd: i32, target_fd: i32, mode: RedirMode, ) -> Result<(), Error>
Add a file descriptor for redirection Port of addfd() from exec.c
Sourcepub fn gethere(&mut self, terminator: &str, strip_tabs: bool) -> String
pub fn gethere(&mut self, terminator: &str, strip_tabs: bool) -> String
Get heredoc content Port of gethere() from exec.c
Sourcepub fn getherestr(&mut self, word: &str) -> String
pub fn getherestr(&mut self, word: &str) -> String
Get herestring content Port of getherestr() from exec.c
Sourcepub fn resolvebuiltin(&self, name: &str) -> Option<BuiltinType>
pub fn resolvebuiltin(&self, name: &str) -> Option<BuiltinType>
Resolve a builtin command Port of resolvebuiltin() from exec.c
Sourcepub fn cancd(&self, path_str: &str) -> bool
pub fn cancd(&self, path_str: &str) -> bool
Check if cd is possible Port of cancd() from exec.c
Sourcepub fn commandnotfound(&mut self, name: &str, args: &[String]) -> i32
pub fn commandnotfound(&mut self, name: &str, args: &[String]) -> i32
Command not found handler Port of commandnotfound() from exec.c
Trait Implementations§
Source§impl Default for ShellExecutor
impl Default for ShellExecutor
Source§fn default() -> ShellExecutor
fn default() -> ShellExecutor
Auto Trait Implementations§
impl !Freeze for ShellExecutor
impl !RefUnwindSafe for ShellExecutor
impl Send for ShellExecutor
impl !Sync for ShellExecutor
impl Unpin for ShellExecutor
impl UnsafeUnpin for ShellExecutor
impl !UnwindSafe for ShellExecutor
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.