pub struct CustomFunction {
pub iri: NamedNode,
pub min_args: usize,
pub max_args: usize,
pub eval_ground: fn(&[Term]) -> CustomEval,
pub eval_encoded: Option<fn(&[EncodedTerm]) -> CustomEval>,
pub eval_encoded_cached: Option<fn(&[EncodedTerm], &dyn PreparedLiteralCache) -> CustomEval>,
}Expand description
A registered custom function: IRI, arity bounds, and its callables.
Plain fn pointers — deterministic, no captures, no allocations at
registration beyond the map entry (systems-minded per AGENTS.md).
Fields§
§iri: NamedNodeInvoking IRI, e.g. xsd:integer for the cast.
min_args: usizeMinimum argument count.
max_args: usizeMaximum argument count.
eval_ground: fn(&[Term]) -> CustomEvalRequired: evaluate over resolved terms (residual / ground path).
eval_encoded: Option<fn(&[EncodedTerm]) -> CustomEval>Optional: evaluate over encoded terms (early path, no registry I/O).
Returning CustomEval::NeedsResolve escalates the row to the ground
path through the standard mechanism.
eval_encoded_cached: Option<fn(&[EncodedTerm], &dyn PreparedLiteralCache) -> CustomEval>Optional encoded evaluator that may reuse query-local prepared values.
A cache miss returns CustomEval::NeedsResolve so the ordinary
encoded/ground fallback remains unchanged.
Implementations§
Source§impl CustomFunction
impl CustomFunction
Sourcepub fn capability(&self) -> ExprCapability
pub fn capability(&self) -> ExprCapability
Planning capability, derived from the encoded impl’s presence.
Planning capability follows only eval_encoded. A cache-aware
evaluator is a residual-retry optimization: changing classification
here would move a function out of the residual stage before planner
rewrites that own that stage have run.
Trait Implementations§
Source§impl Clone for CustomFunction
impl Clone for CustomFunction
Source§fn clone(&self) -> CustomFunction
fn clone(&self) -> CustomFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CustomFunction
impl RefUnwindSafe for CustomFunction
impl Send for CustomFunction
impl Sync for CustomFunction
impl Unpin for CustomFunction
impl UnsafeUnpin for CustomFunction
impl UnwindSafe for CustomFunction
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].