pub enum Value {
}Variants§
List(Arc<Vec<Value>>)
Map(Map)
Function(Arc<String>, Option<Box<Value>>)
Int(i64)
Float(f64)
String(Arc<String>)
Bytes(Arc<Vec<u8>>)
Bool(bool)
Duration(Duration)
Timestamp(DateTime<FixedOffset>)
Regex(Regex)
Ip(IpNetwork)
Null
Implementations§
Source§impl Value
impl Value
pub fn type_of(&self) -> ValueType
pub fn error_expected_type(&self, expected: ValueType) -> ExecutionError
Source§impl Value
impl Value
pub fn resolve_all(expr: &[Expression], ctx: &Context<'_>) -> ResolveResult
pub fn resolve(expr: &Expression, ctx: &Context<'_>) -> ResolveResult
Source§impl Value
impl Value
Sourcepub fn json(&self) -> Result<Value, ConvertToJsonError<'_>>
pub fn json(&self) -> Result<Value, ConvertToJsonError<'_>>
Converts a CEL value to a JSON value.
§Example
use bel::{Context, Program};
let program = Program::compile("null").unwrap();
let value = program.execute(&Context::default()).unwrap();
let result = value.json().unwrap();
assert_eq!(result, serde_json::Value::Null);Trait Implementations§
impl Eq for Value
Source§impl From<DateTime<FixedOffset>> for Value
impl From<DateTime<FixedOffset>> for Value
Source§fn from(value: DateTime<FixedOffset>) -> Self
fn from(value: DateTime<FixedOffset>) -> Self
Converts to this type from the input type.
Source§impl From<Value> for ResolveResult
impl From<Value> for ResolveResult
Source§impl PartialOrd for Value
impl PartialOrd for Value
Source§impl TryIntoValue for Value
impl TryIntoValue for Value
type Error = Infallible
fn try_into_value(self) -> Result<Value, Self::Error>
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
Attempts to downcast this to
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Attempts to downcast owned
Self to T,
useful only in generic context as a workaround for specializationSource§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