pub enum CelValue {
Show 18 variants
Int(i64),
UInt(u64),
Float(f64),
Bool(bool),
String(String),
Bytes(CelBytes),
List(Vec<CelValue>),
Map(HashMap<String, CelValue>),
Null,
Ident(String),
Type(String),
TimeStamp(DateTime<Utc>),
Duration(Duration),
ByteCode(CelByteCode),
Message(Box<dyn MessageDyn>),
Enum {
descriptor: EnumDescriptor,
value: i32,
},
Dyn(Arc<dyn CelValueDyn>),
Err(CelError),
}Expand description
The basic value of the CEL interpreter.
Houses all possible types and implements most of the valid operations within the interpreter
Variants§
Int(i64)
UInt(u64)
Float(f64)
Bool(bool)
String(String)
Bytes(CelBytes)
List(Vec<CelValue>)
Map(HashMap<String, CelValue>)
Null
Ident(String)
Type(String)
TimeStamp(DateTime<Utc>)
Duration(Duration)
ByteCode(CelByteCode)
Message(Box<dyn MessageDyn>)
Enum
Dyn(Arc<dyn CelValueDyn>)
Err(CelError)
Implementations§
Source§impl CelValue
impl CelValue
pub fn from_int(val: i64) -> CelValue
pub fn from_uint(val: u64) -> CelValue
pub fn from_float(val: f64) -> CelValue
pub fn from_bool(val: bool) -> CelValue
pub fn true_() -> CelValue
pub fn false_() -> CelValue
pub fn from_string(val: String) -> CelValue
pub fn from_str(val: &str) -> CelValue
pub fn from_bytes(val: Vec<u8>) -> CelValue
pub fn from_byte_slice(val: &[u8]) -> CelValue
pub fn from_list(val: Vec<CelValue>) -> CelValue
pub fn from_val_slice(val: &[CelValue]) -> CelValue
pub fn from_map(val: HashMap<String, CelValue>) -> CelValue
pub fn from_null() -> CelValue
pub fn from_ident(val: &str) -> CelValue
pub fn from_proto_msg(val: Box<dyn MessageDyn>) -> CelValue
pub fn from_proto_enum(descriptor: EnumDescriptor, value: i32) -> CelValue
pub fn from_type(val: &str) -> CelValue
pub fn from_timestamp(val: DateTime<Utc>) -> CelValue
pub fn from_duration(val: Duration) -> CelValue
pub fn from_dyn(val: Arc<dyn CelValueDyn>) -> CelValue
pub fn from_err(val: CelError) -> CelValue
pub fn value_error(msg: &str) -> CelValue
pub fn argument_error(msg: &str) -> CelValue
pub fn internal_error(msg: &str) -> CelValue
pub fn invalid_op_error(msg: &str) -> CelValue
pub fn runtime_error(msg: &str) -> CelValue
pub fn binding_error(sym_name: &str) -> CelValue
pub fn attribute(parent_name: &str, field_name: &str) -> CelError
pub fn into_result(self) -> CelResult<CelValue>
pub fn is_true(&self) -> bool
pub fn is_err(&self) -> bool
pub fn is_obj(&self) -> bool
pub fn is_zero(&self) -> bool
pub fn int_type() -> CelValue
pub fn uint_type() -> CelValue
pub fn float_type() -> CelValue
pub fn bool_type() -> CelValue
pub fn string_type() -> CelValue
pub fn bytes_type() -> CelValue
pub fn list_type() -> CelValue
pub fn map_type() -> CelValue
pub fn null_type() -> CelValue
pub fn dyn_type() -> CelValue
pub fn ident_type() -> CelValue
pub fn type_type() -> CelValue
pub fn timestamp_type() -> CelValue
pub fn duration_type() -> CelValue
pub fn bytecode_type() -> CelValue
pub fn err_type() -> CelValue
pub fn message_type(desc: &MessageDescriptor) -> CelValue
pub fn enum_type(desc: &EnumDescriptor) -> CelValue
pub fn is_null(&self) -> bool
pub fn neq(self, rhs: CelValue) -> CelValue
pub fn ord(self, rhs_value: CelValue) -> CelResult<Option<Ordering>>
pub fn lt(self, rhs: CelValue) -> CelValue
pub fn gt(self, rhs: CelValue) -> CelValue
pub fn le(self, rhs: CelValue) -> CelValue
pub fn ge(self, rhs: CelValue) -> CelValue
pub fn or(&self, rhs: &CelValue) -> CelValue
pub fn in_(self, rhs: CelValue) -> CelValue
pub fn and(self, rhs: CelValue) -> CelValue
pub fn index(self, ival: CelValue) -> CelValue
Trait Implementations§
Source§impl CelValueDyn for CelValue
impl CelValueDyn for CelValue
Source§impl<'de> Deserialize<'de> for CelValue
impl<'de> Deserialize<'de> for CelValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<ReflectValueRef<'a>> for CelValue
Available on crate feature protobuf only.
impl<'a> From<ReflectValueRef<'a>> for CelValue
Available on crate feature
protobuf only.Source§fn from(value: ReflectValueRef<'_>) -> Self
fn from(value: ReflectValueRef<'_>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CelValue
impl !RefUnwindSafe for CelValue
impl Send for CelValue
impl Sync for CelValue
impl Unpin for CelValue
impl !UnwindSafe for CelValue
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