Skip to main content

ValueRepr

Trait ValueRepr 

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

Source

type Value: 'static

The concrete, owned Rust representation.

Required Methods§

Source

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§

Source§

impl ValueRepr for Nil

Source§

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

Source§

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

Source§

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

Source§

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

Source§

type Value = T