Skip to main content

Module owned_value

Module owned_value 

Source
Expand description

Whole-value ownership with complete checked representation witnesses. Owns an erased whole value together with its frozen ownership descriptor.

Checked host conversion validates the complete representation before moving:

use cel_runtime::owned_value::OwnedValue;
use cel_runtime::value_type::{ArrayOf, Leaf};
use cel_runtime::Array;
let array = Array::from_vec(vec![String::from("owned")]);
let pointer = array.as_slice().as_ptr();
let owner = OwnedValue::new::<ArrayOf<Leaf<String>>>(array);
let array = owner.try_into_typed::<ArrayOf<Leaf<String>>>().unwrap();
assert_eq!(array.as_slice().as_ptr(), pointer);

Structs§

OwnedValue
Owns exactly one live erased value and its complete immutable descriptor.
ValueFormatter
Binds recursive debug capabilities independently of a value’s ownership.