[−][src]Enum entity::Value
Represents either a primitive or complex value
Variants
Primitive(PrimitiveValue)
Text(String)
Implementations
impl Value
[src]
pub fn is_type(&self, r#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<PrimitiveValue>
[src]
Converts into underlying primitive value if representing one
pub fn to_primitive_type(&self) -> Option<PrimitiveValueType>
[src]
Converts into underlying primitive type if representing one
pub fn try_into_option<T: TryFrom<Value, Error = &'static str>>(
self
) -> Result<Option<T>, &'static str>
[src]
self
) -> Result<Option<T>, &'static str>
Attempts to convert the value to an underlying option type, succeeding if Value is the Optional variant and the inner value can be converted to the specified type.
This is only needed due to a blanket impl in the standard library
blocking the ability to implement TryFrom<Value> for Option<T>
,
which will be available some day once specialization is implemented:
https://github.com/rust-lang/rust/issues/31844
Trait Implementations
impl Clone for Value
[src]
impl Debug for Value
[src]
impl Eq for Value
[src]
impl<'a> From<&'a Value> for ValueType
[src]
pub 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: Into<Value>> From<BTreeMap<String, T>> for Value
[src]
pub fn from(map: BTreeMap<String, T>) -> Self
[src]
Converts a btree map of string keys and some value into a value map
impl<T: Into<Value>> From<BTreeSet<T>> for Value
[src]
impl<T: Into<Value>> From<BinaryHeap<T>> for Value
[src]
pub fn from(list: BinaryHeap<T>) -> Self
[src]
Converts a binary heap of some value into a value list
impl<T: Into<Value>> From<HashMap<String, T, RandomState>> for Value
[src]
pub fn from(map: HashMap<String, T>) -> Self
[src]
Converts a hashmap of string keys and some value into a value map
impl<T: Into<Value>> From<HashSet<T, RandomState>> for Value
[src]
impl<T: Into<Value>> From<LinkedList<T>> for Value
[src]
pub fn from(list: LinkedList<T>) -> Self
[src]
Converts a linked list of some value into a value list
impl<T: Into<Value>> From<Option<T>> for Value
[src]
impl From<PrimitiveValue> for Value
[src]
pub fn from(v: PrimitiveValue) -> Self
[src]
Converts a primitive value into a value without any allocation
impl From<String> for Value
[src]
impl From<Value> for ValueType
[src]
impl<T: Into<Value>> From<Vec<T, Global>> for Value
[src]
impl<T: Into<Value>> 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]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Value> for Value
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
Compares two values of same type for equality, otherwise returns false
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Value> for Value
[src]
pub fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
Compares same variants for ordering, otherwise returns none
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
[src]
impl Send for Value
[src]
impl Sync for Value
[src]
impl Unpin for Value
[src]
impl UnwindSafe for Value
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,