Trait SegmentCallable
pub trait SegmentCallable<Args> {
type Output;
// Required method
fn call(&self, args: Args) -> Self::Output;
}Expand description
Callable segment abstraction for uniform invocation across arities.
This trait invokes statically typed stack segments; crate::Callable is
the separate shared native/interpreted value facade.
§Examples
use cel_runtime::{Segment, SegmentCallable};
let body = Segment::<()>::new().op0(|| 7i32);
assert_eq!(body.call(()).unwrap(), 7);Required Associated Types§
type Output
type Output
The result type produced by calling with Args.
Required Methods§
fn call(&self, args: Args) -> Self::Output
fn call(&self, args: Args) -> Self::Output
Invokes the segment with the supplied arguments.
Implementations return the statically described result or an operation error after cleaning the owned execution frame.
- Complexity: O(n) dispatches plus callback costs for n operations; allocates the maximum live frame.
§Examples
See SegmentCallable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".