Enum EvaluationContextFieldValue

Source
pub enum EvaluationContextFieldValue {
    Bool(bool),
    Int(i64),
    Float(f64),
    String(String),
    DateTime(OffsetDateTime),
    Struct(Arc<dyn Any + Send + Sync>),
}
Expand description

Value type of evaluation context custom fields.

Variants§

§

Bool(bool)

§

Int(i64)

§

Float(f64)

§

String(String)

§

DateTime(OffsetDateTime)

§

Struct(Arc<dyn Any + Send + Sync>)

Implementations§

Source§

impl EvaluationContextFieldValue

Source

pub fn new_struct<T>(value: T) -> Self
where T: Any + Send + Sync,

Create a new EvaluationContextFieldValue instance with given struct value.

Source

pub fn is_bool(&self) -> bool

Return true if this is a bool value.

Source

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

Try to convert self to bool.

Source

pub fn is_i64(&self) -> bool

Return true if this is an int value.

Source

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

Try to convert self to int.

Source

pub fn is_f64(&self) -> bool

Return true if this is a float value.

Source

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

Try to convert self to float.

Source

pub fn is_str(&self) -> bool

Return true if this is a string value.

Source

pub fn as_str(&self) -> Option<&str>

Try to convert self to string.

Source

pub fn is_date_time(&self) -> bool

Return true if this is a OffsetDateTime value.

Source

pub fn as_date_time(&self) -> Option<&OffsetDateTime>

Try to convert self to OffsetDateTime.

Source

pub fn is_struct(&self) -> bool

Return true if this is a struct value.

Source

pub fn as_struct(&self) -> Option<Arc<dyn Any + Send + Sync>>

Try to convert self to struct.

Trait Implementations§

Source§

impl Clone for EvaluationContextFieldValue

Source§

fn clone(&self) -> EvaluationContextFieldValue

Returns a copy 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 EvaluationContextFieldValue

Source§

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

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

impl From<&str> for EvaluationContextFieldValue

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl<T: Any + Send + Sync> From<Arc<T>> for EvaluationContextFieldValue

Source§

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

Converts to this type from the input type.
Source§

impl From<OffsetDateTime> for EvaluationContextFieldValue

Source§

fn from(value: OffsetDateTime) -> Self

Converts to this type from the input type.
Source§

impl From<String> for EvaluationContextFieldValue

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for EvaluationContextFieldValue

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for EvaluationContextFieldValue

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for EvaluationContextFieldValue

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for EvaluationContextFieldValue

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for EvaluationContextFieldValue

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for EvaluationContextFieldValue

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for EvaluationContextFieldValue

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for EvaluationContextFieldValue

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for EvaluationContextFieldValue

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for EvaluationContextFieldValue

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EvaluationContextFieldValue

Source§

fn eq(&self, other: &Self) -> 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.

Auto Trait Implementations§

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> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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.