Enum Value

Source
pub enum Value {
Show 17 variants Null, Bool(bool), Int(i64), Uint(u64), Double(f64), String(StringValue), Bytes(BytesValue), Struct(()), Duration(Duration), Timestamp(Timestamp), List(ListValue), Map(MapValue), Unknown(()), Type(ValueType), Error(Error), Opaque(OpaqueValue), Optional(OptionalValue),
}
Expand description

Main CEL value type.

Value is the core value type of the CEL expression system, supporting all data types defined by the CEL specification. Each variant corresponds to a CEL basic type or composite type.

§CEL Type Mapping

  • Null → CEL null
  • Bool → CEL bool
  • Int → CEL int (64-bit signed integer)
  • Uint → CEL uint (64-bit unsigned integer)
  • Double → CEL double (64-bit floating point)
  • String → CEL string
  • Bytes → CEL bytes
  • Duration → CEL duration (Protocol Buffers Duration)
  • Timestamp → CEL timestamp (Protocol Buffers Timestamp)
  • List → CEL list
  • Map → CEL map
  • Type → CEL type (type value)
  • Error → CEL error
  • Opaque → Opaque custom types
  • Optional → Optional value type

§Examples

use cel_cxx::Value;

// Basic types
let null_val = Value::Null;
let bool_val = Value::Bool(true);
let int_val = Value::Int(-42);
let uint_val = Value::Uint(42u64);
let double_val = Value::Double(3.14);
let string_val = Value::String("hello".to_string().into());
let bytes_val = Value::Bytes(vec![1, 2, 3].into());

// Time types
let duration = Value::Duration(chrono::Duration::seconds(30));
let timestamp = Value::Timestamp(chrono::Utc::now());

// Container types
let list = Value::List(vec![Value::Int(1), Value::Int(2)]);

Variants§

§

Null

Null value

§

Bool(bool)

Boolean value

§

Int(i64)

Signed 64-bit integer

§

Uint(u64)

Unsigned 64-bit integer

§

Double(f64)

64-bit floating point number

§

String(StringValue)

UTF-8 string

§

Bytes(BytesValue)

Byte array

§

Struct(())

Struct (not yet implemented)

§

Duration(Duration)

Duration (Protocol Buffers Duration)

§

Timestamp(Timestamp)

Timestamp (Protocol Buffers Timestamp)

§

List(ListValue)

List of values

§

Map(MapValue)

Key-value map

§

Unknown(())

Unknown type (not yet implemented)

§

Type(ValueType)

CEL type value

§

Error(Error)

Error value

§

Opaque(OpaqueValue)

Opaque custom type

§

Optional(OptionalValue)

Optional value type

Implementations§

Source§

impl Value

Source

pub fn kind(&self) -> Kind

Returns the kind of this value.

Returns the corresponding Kind enum for fast type checking.

§Examples
use cel_cxx::{Value, Kind};

let val = Value::String("hello".to_string().into());
assert_eq!(val.kind(), Kind::String);

let val = Value::List(vec![]);
assert_eq!(val.kind(), Kind::List);
Source

pub fn value_type(&self) -> ValueType

Returns the concrete type of this value.

Returns detailed ValueType information including generic parameters. For container types (List, Map), infers element or key-value types.

§Type Inference Rules
  • List: Returns specific List<T> if all elements have the same type; otherwise List<dyn>
  • Map: Infers key and value types; uses dyn types if inconsistent
  • Optional: Infers type from contained value; uses Optional<dyn> for empty values
§Examples
use cel_cxx::{Value, ValueType, ListType};

let val = Value::String("hello".to_string().into());
assert_eq!(val.value_type(), ValueType::String);

// Homogeneous list
let list = Value::List(vec![Value::Int(1), Value::Int(2)]);
assert_eq!(list.value_type(), ValueType::List(ListType::new(ValueType::Int)));

// Heterogeneous list
let mixed_list = Value::List(vec![Value::Int(1), Value::String("hello".to_string().into())]);
assert_eq!(mixed_list.value_type(), ValueType::List(ListType::new(ValueType::Dyn)));
Source

pub fn is_null(&self) -> bool

Returns true if this value is a null value.

Source

pub fn is_bool(&self) -> bool

Returns true if this value is a boolean value.

Source

pub fn is_int(&self) -> bool

Returns true if this value is a signed integer value.

Source

pub fn is_uint(&self) -> bool

Returns true if this value is an unsigned integer value.

Source

pub fn is_double(&self) -> bool

Returns true if this value is a double value.

Source

pub fn is_string(&self) -> bool

Returns true if this value is a string value.

Source

pub fn is_bytes(&self) -> bool

Returns true if this value is a byte array value.

Source

pub fn is_struct(&self) -> bool

Returns true if this value is a struct value.

Source

pub fn is_duration(&self) -> bool

Returns true if this value is a duration value.

Source

pub fn is_timestamp(&self) -> bool

Returns true if this value is a timestamp value.

Source

pub fn is_list(&self) -> bool

Returns true if this value is a list value.

Source

pub fn is_map(&self) -> bool

Returns true if this value is a map value.

Source

pub fn is_unknown(&self) -> bool

Returns true if this value is an unknown value.

Source

pub fn is_type(&self) -> bool

Returns true if this value is a type value.

Source

pub fn is_error(&self) -> bool

Returns true if this value is an error value.

Source

pub fn is_opaque(&self) -> bool

Returns true if this value is an opaque value.

Source

pub fn is_optional(&self) -> bool

Returns true if this value is an optional value.

Source

pub fn as_bool(&self) -> Option<&bool>

Returns the boolean value if this value is a boolean value.

Source

pub fn as_int(&self) -> Option<&i64>

Returns the signed integer value if this value is a signed integer value.

Source

pub fn as_uint(&self) -> Option<&u64>

Returns the unsigned integer value if this value is an unsigned integer value.

Source

pub fn as_double(&self) -> Option<&f64>

Returns the double value if this value is a double value.

Source

pub fn as_string(&self) -> Option<&StringValue>

Returns the string value if this value is a string value.

Source

pub fn as_bytes(&self) -> Option<&BytesValue>

Returns the byte array value if this value is a byte array value.

Source

pub fn as_struct(&self) -> Option<&()>

Returns the struct value if this value is a struct value.

Source

pub fn as_duration(&self) -> Option<&Duration>

Returns the duration value if this value is a duration value.

Source

pub fn as_timestamp(&self) -> Option<&Timestamp>

Returns the timestamp value if this value is a timestamp value.

Source

pub fn as_list(&self) -> Option<&ListValue>

Returns the list value if this value is a list value.

Source

pub fn as_map(&self) -> Option<&MapValue>

Returns the map value if this value is a map value.

Source

pub fn as_unknown(&self) -> Option<&()>

Returns the unknown value if this value is an unknown value.

Source

pub fn as_type(&self) -> Option<&ValueType>

Returns the type value if this value is a type value.

Source

pub fn as_error(&self) -> Option<&Error>

Returns the error value if this value is an error value.

Source

pub fn as_opaque(&self) -> Option<&OpaqueValue>

Returns the opaque value if this value is an opaque value.

Source

pub fn as_optional(&self) -> Option<&OptionalValue>

Returns the optional value if this value is an optional value.

Source

pub fn as_bool_mut(&mut self) -> Option<&mut bool>

Returns a mutable reference to the boolean value if this value is a boolean value.

Source

pub fn as_int_mut(&mut self) -> Option<&mut i64>

Returns a mutable reference to the signed integer value if this value is a signed integer value.

Source

pub fn as_uint_mut(&mut self) -> Option<&mut u64>

Returns a mutable reference to the unsigned integer value if this value is an unsigned integer value.

Source

pub fn as_double_mut(&mut self) -> Option<&mut f64>

Returns a mutable reference to the double value if this value is a double value.

Source

pub fn as_string_mut(&mut self) -> Option<&mut StringValue>

Returns a mutable reference to the string value if this value is a string value.

Source

pub fn as_bytes_mut(&mut self) -> Option<&mut BytesValue>

Returns a mutable reference to the byte array value if this value is a byte array value.

Source

pub fn as_struct_mut(&mut self) -> Option<&mut ()>

Returns a mutable reference to the struct value if this value is a struct value.

Source

pub fn as_duration_mut(&mut self) -> Option<&mut Duration>

Returns a mutable reference to the duration value if this value is a duration value.

Source

pub fn as_timestamp_mut(&mut self) -> Option<&mut Timestamp>

Returns a mutable reference to the timestamp value if this value is a timestamp value.

Source

pub fn as_list_mut(&mut self) -> Option<&mut ListValue>

Returns a mutable reference to the list value if this value is a list value.

Source

pub fn as_map_mut(&mut self) -> Option<&mut MapValue>

Returns a mutable reference to the map value if this value is a map value.

Source

pub fn as_unknown_mut(&mut self) -> Option<&mut ()>

Returns a mutable reference to the unknown value if this value is an unknown value.

Source

pub fn as_type_mut(&mut self) -> Option<&mut ValueType>

Returns a mutable reference to the type value if this value is a type value.

Source

pub fn as_error_mut(&mut self) -> Option<&mut Error>

Returns a mutable reference to the error value if this value is an error value.

Source

pub fn as_opaque_mut(&mut self) -> Option<&mut OpaqueValue>

Returns a mutable reference to the opaque value if this value is an opaque value.

Source

pub fn as_optional_mut(&mut self) -> Option<&mut OptionalValue>

Returns a mutable reference to the optional value if this value is an optional value.

Source

pub fn into_null(self) -> Option<()>

Converts the value to a null value.

Source

pub fn into_bool(self) -> Option<bool>

Converts the value to a boolean value.

Source

pub fn into_int(self) -> Option<i64>

Converts the value to a signed integer value.

Source

pub fn into_uint(self) -> Option<u64>

Converts the value to an unsigned integer value.

Source

pub fn into_double(self) -> Option<f64>

Converts the value to a double value.

Source

pub fn into_string(self) -> Option<StringValue>

Converts the value to a string value.

Source

pub fn into_bytes(self) -> Option<BytesValue>

Converts the value to a byte array value.

Source

pub fn into_struct(self) -> Option<()>

Converts the value to a struct value.

Source

pub fn into_duration(self) -> Option<Duration>

Converts the value to a duration value.

Source

pub fn into_timestamp(self) -> Option<Timestamp>

Converts the value to a timestamp value.

Source

pub fn into_list(self) -> Option<ListValue>

Converts the value to a list value.

Source

pub fn into_map(self) -> Option<MapValue>

Converts the value to a map value.

Source

pub fn into_unknown(self) -> Option<()>

Converts the value to an unknown value.

Source

pub fn into_type(self) -> Option<ValueType>

Converts the value to a type value.

Source

pub fn into_error(self) -> Option<Error>

Converts the value to an error value.

Source

pub fn into_opaque(self) -> Option<OpaqueValue>

Converts the value to an opaque value.

Source

pub fn into_optional(self) -> Option<OptionalValue>

Converts the value to an optional value.

Source

pub fn unwrap_null(self)

Converts the value to a null value and panics if the value is not a null value.

Source

pub fn unwrap_bool(self) -> bool

Converts the value to a boolean value and panics if the value is not a boolean value.

Source

pub fn unwrap_int(self) -> i64

Converts the value to a signed integer value and panics if the value is not a signed integer value.

Source

pub fn unwrap_uint(self) -> u64

Converts the value to an unsigned integer value and panics if the value is not an unsigned integer value.

Source

pub fn unwrap_double(self) -> f64

Converts the value to a double value and panics if the value is not a double value.

Source

pub fn unwrap_string(self) -> StringValue

Converts the value to a string value and panics if the value is not a string value.

Source

pub fn unwrap_bytes(self) -> BytesValue

Converts the value to a byte array value and panics if the value is not a byte array value.

Source

pub fn unwrap_struct(self)

Converts the value to a struct value and panics if the value is not a struct value.

Source

pub fn unwrap_duration(self) -> Duration

Converts the value to a duration value and panics if the value is not a duration value.

Source

pub fn unwrap_timestamp(self) -> Timestamp

Converts the value to a timestamp value and panics if the value is not a timestamp value.

Source

pub fn unwrap_list(self) -> ListValue

Converts the value to a list value and panics if the value is not a list value.

Source

pub fn unwrap_map(self) -> MapValue

Converts the value to a map value and panics if the value is not a map value.

Source

pub fn unwrap_unknown(self)

Converts the value to an unknown value and panics if the value is not an unknown value.

Source

pub fn unwrap_type(self) -> ValueType

Converts the value to a type value and panics if the value is not a type value.

Source

pub fn unwrap_error(self) -> Error

Converts the value to an error value and panics if the value is not an error value.

Source

pub fn unwrap_opaque(self) -> OpaqueValue

Converts the value to an opaque value and panics if the value is not an opaque value.

Source

pub fn unwrap_optional(self) -> OptionalValue

Converts the value to an optional value and panics if the value is not an optional value.

Source

pub fn expect_null(self, msg: &str)

Converts the value to a null value and panics if the value is not a null value.

Source

pub fn expect_bool(self, msg: &str) -> bool

Converts the value to a boolean value and panics if the value is not a boolean value.

Source

pub fn expect_int(self, msg: &str) -> i64

Converts the value to a signed integer value and panics if the value is not a signed integer value.

Source

pub fn expect_uint(self, msg: &str) -> u64

Converts the value to an unsigned integer value and panics if the value is not an unsigned integer value.

Source

pub fn expect_double(self, msg: &str) -> f64

Converts the value to a double value and panics if the value is not a double value.

Source

pub fn expect_string(self, msg: &str) -> StringValue

Converts the value to a string value and panics if the value is not a string value.

Source

pub fn expect_bytes(self, msg: &str) -> BytesValue

Converts the value to a byte array value and panics if the value is not a byte array value.

Source

pub fn expect_struct(self, msg: &str)

Converts the value to a struct value and panics if the value is not a struct value.

Source

pub fn expect_duration(self, msg: &str) -> Duration

Converts the value to a duration value and panics if the value is not a duration value.

Source

pub fn expect_timestamp(self, msg: &str) -> Timestamp

Converts the value to a timestamp value and panics if the value is not a timestamp value.

Source

pub fn expect_list(self, msg: &str) -> ListValue

Converts the value to a list value and panics if the value is not a list value.

Source

pub fn expect_map(self, msg: &str) -> MapValue

Converts the value to a map value and panics if the value is not a map value.

Source

pub fn expect_unknown(self, msg: &str)

Converts the value to an unknown value and panics if the value is not an unknown value.

Source

pub fn expect_type(self, msg: &str) -> ValueType

Converts the value to a type value and panics if the value is not a type value.

Source

pub fn expect_error(self, msg: &str) -> Error

Converts the value to an error value and panics if the value is not an error value.

Source

pub fn expect_opaque(self, msg: &str) -> OpaqueValue

Converts the value to an opaque value and panics if the value is not an opaque value.

Source

pub fn expect_optional(self, msg: &str) -> OptionalValue

Converts the value to an optional value and panics if the value is not an optional value.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Value

Source§

fn default() -> Value

Returns the “default value” for a type. Read more
Source§

impl Display for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: IntoMapKey + Clone, V: IntoValue + Clone> From<&[(K, V)]> for Value

Source§

fn from(value: &[(K, V)]) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoValue + Clone> From<&[T]> for Value

Source§

fn from(value: &[T]) -> Self

Converts to this type from the input type.
Source§

impl From<&[u8]> for Value

Source§

fn from(value: &[u8]) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for Value

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<()> for Value

Source§

fn from(value: ()) -> Self

Converts to this type from the input type.
Source§

impl From<ArcSlice<[u8]>> for Value

Source§

fn from(value: BytesValue) -> Self

Converts to this type from the input type.
Source§

impl From<ArcSlice<str>> for Value

Source§

fn from(value: StringValue) -> Self

Converts to this type from the input type.
Source§

impl<K: IntoMapKey, V: IntoValue> From<BTreeMap<K, V>> for Value

Source§

fn from(value: BTreeMap<K, V>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<[u8]>> for Value

Source§

fn from(value: Box<[u8]>) -> Self

Converts to this type from the input type.
Source§

impl From<Box<dyn Opaque>> for Value

Source§

fn from(value: OpaqueValue) -> Self

Converts to this type from the input type.
Source§

impl From<Box<str>> for Value

Source§

fn from(value: Box<str>) -> Self

Converts to this type from the input type.
Source§

impl From<DateTime<Utc>> for Value

Source§

fn from(value: Timestamp) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Value

Source§

fn from(value: Error) -> Self

Converts to this type from the input type.
Source§

impl<K: IntoMapKey, V: IntoValue> From<HashMap<K, V>> for Value

Source§

fn from(value: HashMap<K, V>) -> Self

Converts to this type from the input type.
Source§

impl<K: IntoMapKey, V: IntoValue> From<LinkedList<(K, V)>> for Value

Source§

fn from(value: LinkedList<(K, V)>) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoValue> From<LinkedList<T>> for Value

Source§

fn from(value: LinkedList<T>) -> Self

Converts to this type from the input type.
Source§

impl From<MapKey> for Value

Source§

fn from(key: MapKey) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoValue> From<Option<T>> for Value

Source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoValue> From<Optional<T>> for Value

Source§

fn from(value: Optional<T>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<SystemTime> for Value

Source§

fn from(value: SystemTime) -> Self

Converts to this type from the input type.
Source§

impl From<TimeDelta> for Value

Source§

fn from(value: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<ValueType> for Value

Source§

fn from(value: ValueType) -> Self

Converts to this type from the input type.
Source§

impl<K: IntoMapKey, V: IntoValue> From<Vec<(K, V)>> for Value

Source§

fn from(value: Vec<(K, V)>) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoValue> From<Vec<T>> for Value

Source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for Value

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl<K: IntoMapKey, V: IntoValue> From<VecDeque<(K, V)>> for Value

Source§

fn from(value: VecDeque<(K, V)>) -> Self

Converts to this type from the input type.
Source§

impl<T: IntoValue> From<VecDeque<T>> for Value

Source§

fn from(value: VecDeque<T>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<isize> for Value

Source§

fn from(value: isize) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for Value

Source§

fn from(value: usize) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> TryFrom<&'a Value> for &'a [u8]

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a BytesValue

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a StringValue

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a Error

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a Duration

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a ValueType

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a bool

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a f64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a i64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a str

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a u64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for ()

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for BytesValue

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for StringValue

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl<'a, K, V> TryFrom<&'a Value> for BTreeMap<K, V>
where K: TryFrom<&'a MapKey, Error = FromMapKeyError> + TypedMapKey + Eq + Hash + Ord, V: TryFrom<&'a Value, Error = FromValueError> + TypedValue,

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for Box<[u8]>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for Box<str>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for Timestamp

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for Error

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl<'a, K, V> TryFrom<&'a Value> for HashMap<K, V>
where K: TryFrom<&'a MapKey, Error = FromMapKeyError> + TypedMapKey + Eq + Hash + Ord, V: TryFrom<&'a Value, Error = FromValueError> + TypedValue,

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, K, V> TryFrom<&'a Value> for LinkedList<(K, V)>
where K: TryFrom<&'a MapKey, Error = FromMapKeyError> + TypedMapKey + Eq + Hash + Ord, V: TryFrom<&'a Value, Error = FromValueError> + TypedValue,

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: TryFrom<&'a Value, Error = FromValueError> + TypedValue> TryFrom<&'a Value> for LinkedList<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: TryFrom<&'a Value, Error = FromValueError> + TypedValue> TryFrom<&'a Value> for Option<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: TryFrom<&'a Value, Error = FromValueError> + TypedValue> TryFrom<&'a Value> for Optional<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for String

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for SystemTime

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for Duration

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for ValueType

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl<'a, K, V> TryFrom<&'a Value> for Vec<(K, V)>
where K: TryFrom<&'a MapKey, Error = FromMapKeyError> + TypedMapKey + Eq + Hash + Ord, V: TryFrom<&'a Value, Error = FromValueError> + TypedValue,

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: TryFrom<&'a Value, Error = FromValueError> + TypedValue> TryFrom<&'a Value> for Vec<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for Vec<u8>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl<'a, K, V> TryFrom<&'a Value> for VecDeque<(K, V)>
where K: TryFrom<&'a MapKey, Error = FromMapKeyError> + TypedMapKey + Eq + Hash + Ord, V: TryFrom<&'a Value, Error = FromValueError> + TypedValue,

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, T: TryFrom<&'a Value, Error = FromValueError> + TypedValue> TryFrom<&'a Value> for VecDeque<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for bool

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for f32

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for f64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for i16

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for i32

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for i64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for isize

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u16

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u32

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for usize

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, <Self as TryFrom<&Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for ()

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for BytesValue

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for StringValue

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl<K, V> TryFrom<Value> for BTreeMap<K, V>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Box<[u8]>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Box<str>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Constant

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Timestamp

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Error

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl<K, V> TryFrom<Value> for HashMap<K, V>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<K, V> TryFrom<Value> for LinkedList<(K, V)>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: TypedValue + TryFrom<Value, Error = FromValueError>> TryFrom<Value> for LinkedList<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for MapKey

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: TryFrom<Value, Error = FromValueError> + TypedValue> TryFrom<Value> for Option<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: TryFrom<Value, Error = FromValueError> + TypedValue> TryFrom<Value> for Optional<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for String

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for SystemTime

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Duration

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for ValueType

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl<K, V> TryFrom<Value> for Vec<(K, V)>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: TypedValue + TryFrom<Value, Error = FromValueError>> TryFrom<Value> for Vec<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Vec<u8>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl<K, V> TryFrom<Value> for VecDeque<(K, V)>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T: TypedValue + TryFrom<Value, Error = FromValueError>> TryFrom<Value> for VecDeque<T>

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for bool

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f32

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i16

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i32

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for isize

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u16

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u32

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u64

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl TryFrom<Value> for usize

Source§

type Error = FromValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Value) -> Result<Self, <Self as TryFrom<Value>>::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl !RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl !UnwindSafe for Value

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more