pub struct ValueFormatter { /* private fields */ }Expand description
Binds recursive debug capabilities independently of a value’s ownership.
The formatter never clones or consumes a value. Each checked formatting boundary validates the complete shape before invoking any leaf hook.
§Examples
use cel_runtime::{Leaf, OwnedValue, ValueType};
let value = OwnedValue::new::<Leaf<i32>>(7)
.with_value_type(ValueType::leaf::<i32>().with_debug::<Leaf<i32>>().unwrap()).unwrap();
let formatter = value.prepare_debug().unwrap();
assert_eq!(formatter.format(&value).unwrap(), "7");Implementations§
Source§impl ValueFormatter
impl ValueFormatter
Sourcepub fn format(&self, value: &OwnedValue) -> Result<String>
pub fn format(&self, value: &OwnedValue) -> Result<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ValueFormatter
impl RefUnwindSafe for ValueFormatter
impl Send for ValueFormatter
impl Sync for ValueFormatter
impl Unpin for ValueFormatter
impl UnsafeUnpin for ValueFormatter
impl UnwindSafe for ValueFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more