Enum entity::Primitive[][src]

pub enum Primitive {
    Bool(bool),
    Char(char),
    Number(Number),
    Unit,
}

Represents a primitive value

Variants

Bool(bool)
Char(char)
Number(Number)
Unit

Implementations

impl Primitive[src]

pub fn is_type(&self, type: PrimitiveType) -> bool[src]

Returns true if this value is of the specified type

pub fn to_type(&self) -> PrimitiveType[src]

Returns the type of this value

pub fn has_same_type(&self, other: &Primitive) -> bool[src]

Returns true if this value and the other value are of the same type

Trait Implementations

impl Clone for Primitive[src]

impl Copy for Primitive[src]

impl Debug for Primitive[src]

impl Eq for Primitive[src]

Value is considered equal, ignoring the fact that NaN != NaN for floats

impl<'a> From<&'a Primitive> for PrimitiveType[src]

impl From<()> for Primitive[src]

impl From<Primitive> for PrimitiveType[src]

impl From<Primitive> for Value[src]

impl From<bool> for Primitive[src]

impl From<char> for Primitive[src]

impl From<f32> for Primitive[src]

impl From<f64> for Primitive[src]

impl From<i128> for Primitive[src]

impl From<i16> for Primitive[src]

impl From<i32> for Primitive[src]

impl From<i64> for Primitive[src]

impl From<i8> for Primitive[src]

impl From<isize> for Primitive[src]

impl From<u128> for Primitive[src]

impl From<u16> for Primitive[src]

impl From<u32> for Primitive[src]

impl From<u64> for Primitive[src]

impl From<u8> for Primitive[src]

impl From<usize> for Primitive[src]

impl Hash for Primitive[src]

impl PartialEq<Primitive> for Primitive[src]

fn eq(&self, other: &Self) -> bool[src]

Compares two primitive values of same type for equality, otherwise returns false

impl PartialOrd<Primitive> for Primitive[src]

fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]

Compares same variants of same type for ordering, otherwise returns none

impl PrimitiveLike for Primitive[src]

impl TryFrom<Value> for Primitive[src]

type Error = Value

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.