pub enum FunctionItem {
Inline {
params: Vec<String>,
sig: Box<FunctionSig>,
body: Expr,
closure: Vec<(String, Value)>,
},
Named {
name: String,
ns: String,
arity: usize,
sig: Option<Box<FunctionSig>>,
},
Partial {
base: Box<FunctionItem>,
bound: Vec<Option<Value>>,
},
}Expand description
A callable XPath 3.1 function item.
Variants§
Inline
An inline function(...){...} — parameter names, the body
expression, and the values of the free variables captured from
the defining scope (static scoping).
Fields
sig: Box<FunctionSig>Declared signature, for function subtyping in instance of.
Named
A reference to a named function (built-in or user-defined),
name#arity, invoked by re-entering function dispatch. name
is the lexical QName used for dispatch; ns is its resolved
namespace URI (the default function namespace for an unprefixed
name), captured at reference time so fn:function-name can
rebuild the expanded QName without the defining scope.
Fields
sig: Option<Box<FunctionSig>>The function’s declared signature, captured at reference time
for function subtyping (instance of function(…)). None
when unknown (built-ins / extensions) — subtyping then falls
back to arity-only matching.
Partial
A partial application: a base function with some arguments
already bound; None slots are the remaining parameters.
Implementations§
Source§impl FunctionItem
impl FunctionItem
Sourcepub fn declared_sig(&self) -> Option<&FunctionSig>
pub fn declared_sig(&self) -> Option<&FunctionSig>
The function’s declared signature, if captured (named user
functions record it at reference time). None for inline,
partial, and built-in items.
Trait Implementations§
Source§impl Clone for FunctionItem
impl Clone for FunctionItem
Source§fn clone(&self) -> FunctionItem
fn clone(&self) -> FunctionItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more