pub struct ZshFuncDef {
pub names: Vec<String>,
pub body: Box<ZshProgram>,
pub tracing: bool,
pub auto_call_args: Option<Vec<String>>,
pub body_source: Option<String>,
}Expand description
Function definition
Fields§
§names: Vec<String>§body: Box<ZshProgram>§tracing: bool§auto_call_args: Option<Vec<String>>Anonymous-function call args. () { body } a b parses as a
FuncDef (auto-named) with auto_call_args = Some(vec!["a", "b"]).
compile_funcdef registers the function then emits a Simple call
with these args.
body_source: Option<String>Original source text of the function body (the bytes between
{ and }, without the braces themselves), captured at parse
time. Populated for function name { body } and function name() { body }
forms; left None for the synthesized inline-funcdef recovery
path. ZshCompiler::compile_funcdef forwards it to
BUILTIN_REGISTER_COMPILED_FN so introspection (whence, which,
${functions[name]}) has canonical source text.
Trait Implementations§
Source§impl Clone for ZshFuncDef
impl Clone for ZshFuncDef
Source§fn clone(&self) -> ZshFuncDef
fn clone(&self) -> ZshFuncDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ZshFuncDef
impl Debug for ZshFuncDef
Source§impl<'de> Deserialize<'de> for ZshFuncDef
impl<'de> Deserialize<'de> for ZshFuncDef
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 ZshFuncDef
impl RefUnwindSafe for ZshFuncDef
impl Send for ZshFuncDef
impl Sync for ZshFuncDef
impl Unpin for ZshFuncDef
impl UnsafeUnpin for ZshFuncDef
impl UnwindSafe for ZshFuncDef
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