pub struct FunctionRegistry { /* private fields */ }Expand description
Case-insensitive registry with separate standard and extension namespaces.
Implementations§
Source§impl FunctionRegistry
impl FunctionRegistry
Sourcepub fn standard() -> Self
pub fn standard() -> Self
Construct a registry containing the supported standard function subset.
Sourcepub fn standard_with_policy(coercion: CoercionPolicy) -> Self
pub fn standard_with_policy(coercion: CoercionPolicy) -> Self
Construct the standard registry with an explicit host coercion policy.
Sourcepub const fn coercion_policy(&self) -> CoercionPolicy
pub const fn coercion_policy(&self) -> CoercionPolicy
Return the active coercion policy.
Sourcepub fn register_extension(
&mut self,
namespace: &str,
name: &str,
notes: &'static str,
handler: FunctionHandler,
) -> CalcResult<()>
pub fn register_extension( &mut self, namespace: &str, name: &str, notes: &'static str, handler: FunctionHandler, ) -> CalcResult<()>
Register an explicitly namespaced extension function.
Namespace and local name are ASCII identifiers and are normalized to uppercase. Standard names cannot be replaced by this API.
Sourcepub fn metadata(&self, name: &str) -> Option<&FunctionMetadata>
pub fn metadata(&self, name: &str) -> Option<&FunctionMetadata>
Return metadata for a registered function.
Sourcepub fn all_metadata(&self) -> impl Iterator<Item = &FunctionMetadata>
pub fn all_metadata(&self) -> impl Iterator<Item = &FunctionMetadata>
Iterate over all compatibility metadata in stable name order.
Sourcepub fn evaluate(
&self,
name: &str,
arguments: &[Argument],
context: &mut dyn EvalContext,
) -> CalcResult
pub fn evaluate( &self, name: &str, arguments: &[Argument], context: &mut dyn EvalContext, ) -> CalcResult
Evaluate already-prepared arguments.
For IF, this method selects only the requested prepared branch, but a
caller that needs to avoid evaluating branch expressions must use
Self::evaluate_lazy.
Sourcepub fn evaluate_lazy<F>(
&self,
name: &str,
argument_count: usize,
evaluate_argument: F,
context: &mut dyn EvalContext,
) -> CalcResult
pub fn evaluate_lazy<F>( &self, name: &str, argument_count: usize, evaluate_argument: F, context: &mut dyn EvalContext, ) -> CalcResult
Evaluate arguments on demand, preserving OpenFormula IF short circuiting.