pub struct ParamTable {Show 46 fields
pub local_level: i32,
pub histchars: [u8; 3],
pub lastval: i64,
pub mypid: i64,
pub lastpid: i64,
pub curhist: i64,
pub lineno: i64,
pub ppid: i64,
pub zsh_subshell: i64,
pub columns: i64,
pub lines: i64,
pub shlvl: i64,
pub funcnest: i64,
pub optind: i64,
pub optarg: String,
pub try_errflag: i64,
pub try_interrupt: i64,
pub rprompt_indent: i64,
pub ifs: String,
pub underscore: String,
pub pparams: Vec<String>,
pub argzero: String,
pub posixzero: String,
pub pipestats: Vec<i32>,
pub prompt: String,
pub prompt2: String,
pub prompt3: String,
pub prompt4: String,
pub rprompt: String,
pub rprompt2: String,
pub sprompt: String,
pub nullcmd: String,
pub readnullcmd: String,
pub postedit: String,
pub wordchars: String,
pub keyboard_hack_char: u8,
pub home: String,
pub term: String,
pub terminfo: String,
pub terminfo_dirs: String,
pub tied: HashMap<String, TiedData>,
pub histsize: i64,
pub savehist: i64,
pub ksh_arrays: bool,
pub posix_argzero: bool,
pub zsh_eval_context: Vec<String>,
/* private fields */
}Fields§
§local_level: i32§histchars: [u8; 3]Shell histchars: [bangchar, hatchar, hashchar]
lastval: i64Last exit status ($?)
mypid: i64PID ($$)
lastpid: i64Last background PID ($!)
curhist: i64Current history command number
lineno: i64Current line number ($LINENO)
ppid: i64Parent PID ($PPID)
zsh_subshell: i64Subshell nesting ($ZSH_SUBSHELL)
columns: i64Terminal columns ($COLUMNS)
lines: i64Terminal lines ($LINES)
shlvl: i64$SHLVL
funcnest: i64Max function nesting ($FUNCNEST)
optind: i64$OPTIND
optarg: String$OPTARG
try_errflag: i64TRY_BLOCK_ERROR
try_interrupt: i64TRY_BLOCK_INTERRUPT
rprompt_indent: i64ZLE_RPROMPT_INDENT
ifs: StringIFS value
underscore: StringUnderscore ($_)
pparams: Vec<String>Positional parameters ($1, $2, …)
argzero: String$0
posixzero: StringPositional zero for POSIX
pipestats: Vec<i32>$pipestatus
prompt: StringPrompt strings
prompt2: String§prompt3: String§prompt4: String§rprompt: String§rprompt2: String§sprompt: String§nullcmd: StringNULLCMD / READNULLCMD
readnullcmd: String§postedit: StringPOSTEDIT
wordchars: StringWORDCHARS
keyboard_hack_char: u8KEYBOARD_HACK
home: StringHOME
term: StringTERM
terminfo: StringTERMINFO
terminfo_dirs: StringTERMINFO_DIRS
tied: HashMap<String, TiedData>Tied parameter bindings
histsize: i64HISTSIZE
savehist: i64SAVEHIST
ksh_arrays: boolOptions state for KSH_ARRAYS etc.
posix_argzero: boolOptions state for POSIX_ARGZERO
zsh_eval_context: Vec<String>Eval context stack
Implementations§
Source§impl ParamTable
impl ParamTable
pub fn new() -> Self
pub fn get_random(&self) -> i64
pub fn get_seconds_int(&self) -> i64
pub fn get_seconds_float(&self) -> f64
Sourcepub fn get_seconds(&self) -> f64
pub fn get_seconds(&self) -> f64
Get the SECONDS value
pub fn set_seconds_type(&mut self, is_float: bool)
Sourcepub fn get(&self, name: &str) -> Option<&ParamValue>
pub fn get(&self, name: &str) -> Option<&ParamValue>
Get a parameter value, resolving specials and namerefs
Sourcepub fn get_value(&self, name: &str) -> Option<ParamValue>
pub fn get_value(&self, name: &str) -> Option<ParamValue>
Get a parameter value, including dynamic specials
Sourcepub fn get_param_mut(&mut self, name: &str) -> Option<&mut Param>
pub fn get_param_mut(&mut self, name: &str) -> Option<&mut Param>
Get mutable parameter
Sourcepub fn set_scalar(&mut self, name: &str, value: &str) -> bool
pub fn set_scalar(&mut self, name: &str, value: &str) -> bool
Set a scalar parameter
Sourcepub fn set_integer(&mut self, name: &str, value: i64) -> bool
pub fn set_integer(&mut self, name: &str, value: i64) -> bool
Set an integer parameter
Sourcepub fn set_assoc(&mut self, name: &str, value: HashMap<String, String>) -> bool
pub fn set_assoc(&mut self, name: &str, value: HashMap<String, String>) -> bool
Set an associative array parameter
Sourcepub fn set_numeric(&mut self, name: &str, val: MNumber) -> bool
pub fn set_numeric(&mut self, name: &str, val: MNumber) -> bool
Set a numeric value (MNumber)
Sourcepub fn augment_scalar(&mut self, name: &str, value: &str) -> bool
pub fn augment_scalar(&mut self, name: &str, value: &str) -> bool
Augmented assignment (+=)
Sourcepub fn augment_array(&mut self, name: &str, value: Vec<String>) -> bool
pub fn augment_array(&mut self, name: &str, value: Vec<String>) -> bool
Augmented assignment for arrays (+=)
Sourcepub fn augment_integer(&mut self, name: &str, value: i64) -> bool
pub fn augment_integer(&mut self, name: &str, value: i64) -> bool
Augmented assignment for integers (+=)
Sourcepub fn set_readonly(&mut self, name: &str) -> bool
pub fn set_readonly(&mut self, name: &str) -> bool
Mark parameter as readonly
Sourcepub fn push_scope(&mut self)
pub fn push_scope(&mut self)
Start a new local scope
Sourcepub fn make_local(&mut self, name: &str)
pub fn make_local(&mut self, name: &str)
Create a local variable (from typeset/local builtin)
Sourcepub fn make_local_typed(&mut self, name: &str, pm_flags: u32)
pub fn make_local_typed(&mut self, name: &str, pm_flags: u32)
Create a local variable with a specific type
Sourcepub fn createparam(&mut self, name: &str, pm_flags: u32) -> bool
pub fn createparam(&mut self, name: &str, pm_flags: u32) -> bool
Create a parameter with given flags. Returns false if already exists and set.
Sourcepub fn resetparam(&mut self, name: &str, new_flags: u32) -> bool
pub fn resetparam(&mut self, name: &str, new_flags: u32) -> bool
Reset parameter to new type (from resetparam in C)
Sourcepub fn set_nameref(&mut self, name: &str, target: &str) -> bool
pub fn set_nameref(&mut self, name: &str, target: &str) -> bool
Create a named reference
Sourcepub fn resolve_nameref<'a>(&'a self, name: &str) -> Option<&'a Param>
pub fn resolve_nameref<'a>(&'a self, name: &str) -> Option<&'a Param>
Resolve a nameref to its ultimate target Param
Sourcepub fn set_loop_var(&mut self, name: &str, value: &str)
pub fn set_loop_var(&mut self, name: &str, value: &str)
Set loop variable (for-loop nameref support)
Sourcepub fn tie_param(&mut self, scalar: &str, array: &str, sep: char)
pub fn tie_param(&mut self, scalar: &str, array: &str, sep: char)
Tie scalar to array with separator (from typeset -T)
Sourcepub fn untie_param(&mut self, name: &str)
pub fn untie_param(&mut self, name: &str)
Untie a parameter pair
Sourcepub fn set_array_element(&mut self, name: &str, index: i64, value: &str) -> bool
pub fn set_array_element(&mut self, name: &str, index: i64, value: &str) -> bool
Set array element by index (1-based, zsh style)
Sourcepub fn get_array_element(&self, name: &str, index: i64) -> Option<String>
pub fn get_array_element(&self, name: &str, index: i64) -> Option<String>
Get array element by index (1-based, zsh style)
Sourcepub fn set_hash_element(&mut self, name: &str, key: &str, value: &str) -> bool
pub fn set_hash_element(&mut self, name: &str, key: &str, value: &str) -> bool
Set associative array element
Sourcepub fn get_hash_element(&self, name: &str, key: &str) -> Option<String>
pub fn get_hash_element(&self, name: &str, key: &str) -> Option<String>
Get associative array element
Sourcepub fn unset_hash_element(&mut self, name: &str, key: &str) -> bool
pub fn unset_hash_element(&mut self, name: &str, key: &str) -> bool
Delete associative array element
Sourcepub fn get_hash_keys(&self, name: &str) -> Vec<String>
pub fn get_hash_keys(&self, name: &str) -> Vec<String>
Get all keys from associative array
Sourcepub fn get_hash_values(&self, name: &str) -> Vec<String>
pub fn get_hash_values(&self, name: &str) -> Vec<String>
Get all values from associative array
Sourcepub fn get_array_slice(&self, name: &str, start: i64, end: i64) -> Vec<String>
pub fn get_array_slice(&self, name: &str, start: i64, end: i64) -> Vec<String>
Get array slice with subscript handling
Sourcepub fn set_array_slice(
&mut self,
name: &str,
start: i64,
end: i64,
val: Vec<String>,
) -> bool
pub fn set_array_slice( &mut self, name: &str, start: i64, end: i64, val: Vec<String>, ) -> bool
Set array slice with subscript handling
Sourcepub fn set_str_slice(
&mut self,
name: &str,
start: i64,
end: i64,
val: &str,
) -> bool
pub fn set_str_slice( &mut self, name: &str, start: i64, end: i64, val: &str, ) -> bool
Set string slice
Sourcepub fn export_param(&mut self, name: &str)
pub fn export_param(&mut self, name: &str)
Export parameter to environment (full version from export_param)
Sourcepub fn arr_fix_env(&mut self, name: &str)
pub fn arr_fix_env(&mut self, name: &str)
Fix environment after array change (from arrfixenv)
pub fn is_empty(&self) -> bool
Sourcepub fn scan_match<F>(&self, pattern: &str, flag_filter: u32, callback: F)
pub fn scan_match<F>(&self, pattern: &str, flag_filter: u32, callback: F)
Scan parameters matching pattern with optional flag filter
Sourcepub fn paramnames(&self, pattern: Option<&str>) -> Vec<String>
pub fn paramnames(&self, pattern: Option<&str>) -> Vec<String>
Get all parameter names matching pattern
Sourcepub fn format_param(&self, name: &str, pf: u32) -> Option<String>
pub fn format_param(&self, name: &str, pf: u32) -> Option<String>
Format a parameter for display (typeset -p output)
Sourcepub fn getparamtype(&self, name: &str) -> &'static str
pub fn getparamtype(&self, name: &str) -> &'static str
Get parameter type string (from getparamtype)
Sourcepub fn copyparam(&self, name: &str) -> Option<ParamValue>
pub fn copyparam(&self, name: &str) -> Option<ParamValue>
Copy a parameter value
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParamTable
impl RefUnwindSafe for ParamTable
impl Send for ParamTable
impl Sync for ParamTable
impl Unpin for ParamTable
impl UnsafeUnpin for ParamTable
impl UnwindSafe for ParamTable
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 more