Skip to main content

ValueRepr

Trait ValueRepr 

pub trait ValueRepr: Sealed {
    type Value: 'static;

    // Required method
    fn value_type() -> ValueType;
}
Expand description

Names a trusted concrete representation without wrapping its runtime value.

Only this crate implements the trait; use Leaf for any foreign host type.

§Examples

use cel_runtime::value_type::{ArrayOf, Leaf, ValueRepr};
use cel_runtime::Array;
let _: <ArrayOf<Leaf<i32>> as ValueRepr>::Value = Array::from_vec(vec![1]);

Required Associated Types§

type Value: 'static

The concrete, owned Rust representation.

Required Methods§

fn value_type() -> ValueType

Returns the complete identity, layout, and ownership plan.

Leaves have no optional capabilities by default.

  • Complexity: O(n) time and space for n nodes in the descriptor tree.
§Examples
use cel_runtime::value_type::{Leaf, ValueRepr, ValueType};
assert!(Leaf::<i32>::value_type().same_shape(&ValueType::leaf::<i32>()));

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

§

impl ValueRepr for Nil

§

type Value = CNil<()>

§

impl<A, R> ValueRepr for FnOf<A, R>
where A: ArgumentList, R: ValueRepr,

§

type Value = Callable<<A as ValueRepr>::Value, <R as ValueRepr>::Value>

§

impl<E> ValueRepr for ArrayOf<E>
where E: ValueRepr,

§

type Value = Array<<E as ValueRepr>::Value>

§

impl<H, T> ValueRepr for Cons<H, T>
where H: ValueRepr, T: List, <T as ValueRepr>::Value: CStackListHeadLimit,

§

type Value = CStackList<<H as ValueRepr>::Value, <T as ValueRepr>::Value>

§

impl<T> ValueRepr for Leaf<T>
where T: 'static,

§

type Value = T