Enum ValueKind

Source
pub enum ValueKind<'bp> {
Show 14 variants Int(i64), Float(f64), Bool(bool), Char(char), Hex(Hex), Color(Color), Str(Cow<'bp, str>), Null, Map, Attributes, List(Box<[ValueKind<'bp>]>), DynList(PendingValue), DynMap(PendingValue), Composite(PendingValue),
}
Expand description

This value can never be part of an evaluation chain, only the return value. It should only ever be the final type that is held by a Value, at the end of an evaluation

Variants§

§

Int(i64)

§

Float(f64)

§

Bool(bool)

§

Char(char)

§

Hex(Hex)

§

Color(Color)

§

Str(Cow<'bp, str>)

§

Null

§

Map

§

Attributes

§

List(Box<[ValueKind<'bp>]>)

§

DynList(PendingValue)

§

DynMap(PendingValue)

§

Composite(PendingValue)

Implementations§

Source§

impl ValueKind<'_>

Source

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

Source

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

Source

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

Source

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

Source

pub fn as_char(&self) -> Option<char>

Source

pub fn as_hex(&self) -> Option<Hex>

Source

pub fn as_color(&self) -> Option<Color>

Source

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

Source

pub fn strings<F>(&self, f: F)
where F: FnMut(&str) -> bool,

Trait Implementations§

Source§

impl<'bp> Clone for ValueKind<'bp>

Source§

fn clone(&self) -> ValueKind<'bp>

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<'bp> Debug for ValueKind<'bp>

Source§

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

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

impl<'a> From<&'a str> for ValueKind<'a>

Source§

fn from(value: &'a str) -> Self

Converts to this type from the input type.
Source§

impl From<Color> for ValueKind<'_>

Source§

fn from(value: Color) -> Self

Converts to this type from the input type.
Source§

impl From<Hex> for ValueKind<'_>

Source§

fn from(value: Hex) -> Self

Converts to this type from the input type.
Source§

impl From<String> for ValueKind<'_>

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl<'bp, T> From<Vec<T>> for ValueKind<'bp>
where T: Into<ValueKind<'bp>>,

Source§

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

Converts to this type from the input type.
Source§

impl From<bool> for ValueKind<'_>

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<char> for ValueKind<'_>

Source§

fn from(value: char) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for ValueKind<'_>

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for ValueKind<'_>

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for ValueKind<'_>

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for ValueKind<'_>

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for ValueKind<'_>

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for ValueKind<'_>

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for ValueKind<'_>

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for ValueKind<'_>

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for ValueKind<'_>

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for ValueKind<'_>

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl<'bp> PartialEq for ValueKind<'bp>

Source§

fn eq(&self, other: &ValueKind<'bp>) -> 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<'bp> PartialOrd for ValueKind<'bp>

Source§

fn partial_cmp(&self, other: &ValueKind<'bp>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<&ValueKind<'_>> for Color

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for Hex

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for bool

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for f32

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for f64

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for i16

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for i32

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for i64

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for i8

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for isize

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for u16

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for u32

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for u64

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for u8

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&ValueKind<'_>> for usize

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'_>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, 'bp> TryFrom<&'a ValueKind<'bp>> for &'a str

Source§

type Error = ()

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

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

Performs the conversion.
Source§

impl<'bp> TryFrom<&ValueKind<'bp>> for char

Source§

type Error = ()

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

fn try_from(value: &ValueKind<'bp>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'bp> StructuralPartialEq for ValueKind<'bp>

Auto Trait Implementations§

§

impl<'bp> Freeze for ValueKind<'bp>

§

impl<'bp> RefUnwindSafe for ValueKind<'bp>

§

impl<'bp> Send for ValueKind<'bp>

§

impl<'bp> Sync for ValueKind<'bp>

§

impl<'bp> Unpin for ValueKind<'bp>

§

impl<'bp> UnwindSafe for ValueKind<'bp>

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