Enum entity::Value[][src]

pub enum Value {
    List(Vec<Value>),
    Map(HashMap<String, Value>),
    Optional(Option<Box<Value>>),
    Primitive(Primitive),
    Text(String),
}

Represents either a primitive or complex value

Variants

List(Vec<Value>)
Optional(Option<Box<Value>>)
Primitive(Primitive)
Text(String)

Implementations

impl Value[src]

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

Returns true if this value is of the specified type

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

Returns the type of this value

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

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

pub fn is_complex(&self) -> bool[src]

Returns true if not representing a primitive value

pub fn is_primitive(&self) -> bool[src]

Returns true if representing a primitive value

pub fn to_primitive(&self) -> Option<Primitive>[src]

Converts into underlying primitive value if representing one

pub fn to_primitive_type(&self) -> Option<PrimitiveType>[src]

Converts into underlying primitive type if representing one

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Eq for Value[src]

impl<'a> From<&'a OsStr> for Value[src]

impl<'a> From<&'a Path> for Value[src]

impl<'a> From<&'a Value> for ValueType[src]

fn from(v: &'a Value) -> Self[src]

Produces the type of the referenced value by recursively iterating through complex types, assuming that the first value in types like list represent the entire set, defaulting to a primitive unit if a complex value does not have any items

impl<'a> From<&'a str> for Value[src]

impl<T: ValueLike> From<BTreeMap<String, T>> for Value[src]

impl<T: ValueLike + Ord> From<BTreeSet<T>> for Value[src]

impl<T: ValueLike + Ord> From<BinaryHeap<T>> for Value[src]

impl<T: ValueLike> From<HashMap<String, T, RandomState>> for Value[src]

impl<T: ValueLike + Hash + Eq> From<HashSet<T, RandomState>> for Value[src]

impl<T: ValueLike> From<LinkedList<T>> for Value[src]

impl<T: ValueLike> From<Option<T>> for Value[src]

impl From<OsString> for Value[src]

impl From<PathBuf> for Value[src]

impl From<Primitive> for Value[src]

impl From<String> for Value[src]

impl From<Value> for ValueType[src]

impl<T: ValueLike> From<Vec<T, Global>> for Value[src]

impl<T: ValueLike> From<VecDeque<T>> for Value[src]

impl From<bool> for Value[src]

impl From<char> for Value[src]

impl From<f32> for Value[src]

impl From<f64> for Value[src]

impl From<i128> for Value[src]

impl From<i16> for Value[src]

impl From<i32> for Value[src]

impl From<i64> for Value[src]

impl From<i8> for Value[src]

impl From<isize> for Value[src]

impl From<u128> for Value[src]

impl From<u16> for Value[src]

impl From<u32> for Value[src]

impl From<u64> for Value[src]

impl From<u8> for Value[src]

impl From<usize> for Value[src]

impl Hash for Value[src]

impl PartialEq<Value> for Value[src]

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

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

impl PartialOrd<Value> for Value[src]

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

Compares same variants for ordering, otherwise returns none

impl TryFrom<Value> for Primitive[src]

type Error = Value

The type returned in the event of a conversion error.

impl ValueLike for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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.