Enum Value

Source
pub enum Value {
Show 17 variants Null, Bool(bool), Int(i64), Uint(u64), Double(f64), String(ArcStr), Bytes(ArcBytes), 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(ArcStr)

UTF-8 string

§

Bytes(ArcBytes)

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)));

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

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

const 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: ArcBytes) -> Self

Converts to this type from the input type.
Source§

impl From<ArcSlice<str>> for Value

Source§

fn from(value: ArcStr) -> 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§

const 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 ArcBytes

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 ArcStr

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 ArcBytes

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 ArcStr

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 ArcBytes

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 ArcStr

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