Skip to main content

SegmentCallable

Trait SegmentCallable 

Source
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§

Source

type Output

The result type produced by calling with Args.

Required Methods§

Source

fn call(&self, args: Args) -> Self::Output

Invokes the segment with the supplied arguments.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, A, B> SegmentCallable<(A, B)> for Segment<(A, B), T>
where T: StackResult + 'static, A: 'static, B: 'static, <T as List>::Tail: EmptyList + CStackListHeadLimit,

Source§

impl<T, A> SegmentCallable<(A,)> for Segment<(A,), T>
where T: StackResult + 'static, A: 'static, <T as List>::Tail: EmptyList + CStackListHeadLimit,

Source§

impl<T> SegmentCallable<()> for Segment<(), T>
where T: StackResult + 'static, <T as List>::Tail: EmptyList + CStackListHeadLimit,