Enum mentat_db::types::ValueType
[−]
[src]
#[repr(u32)]pub enum ValueType { Ref, Boolean, Instant, Long, Double, String, Keyword, Uuid, }
The attribute of each Mentat assertion has a :db/valueType constraining the value to a particular set. Mentat recognizes the following :db/valueType values.
Variants
Ref
Boolean
Instant
Long
Double
String
Keyword
Uuid
Methods
impl ValueType
[src]
impl ValueType
impl ValueType
[src]
impl ValueType
pub fn into_keyword(self) -> Keyword
[src]
pub fn into_keyword(self) -> Keyword
pub fn from_keyword(keyword: &Keyword) -> Option<ValueType>
[src]
pub fn from_keyword(keyword: &Keyword) -> Option<ValueType>
pub fn into_typed_value(self) -> TypedValue
[src]
pub fn into_typed_value(self) -> TypedValue
pub fn into_edn_value(self) -> Value
[src]
pub fn into_edn_value(self) -> Value
pub fn is_numeric(&self) -> bool
[src]
pub fn is_numeric(&self) -> bool
Trait Implementations
impl SQLValueType for ValueType
[src]
impl SQLValueType for ValueType
fn sql_representation(&self) -> (i32, Option<SQLTypeAffinity>)
[src]
fn sql_representation(&self) -> (i32, Option<SQLTypeAffinity>)
Return a pair of the ValueTypeTag for this value type, and the SQLTypeAffinity required to distinguish it from any other types that share the same tag. Read more
fn value_type_tag(&self) -> i32
[src]
fn value_type_tag(&self) -> i32
fn accommodates_integer(&self, int: i64) -> bool
[src]
fn accommodates_integer(&self, int: i64) -> bool
Returns true if the provided integer is in the SQLite value space of this type. For
example, 1
is how we encode true
.
use mentat_core::{ValueType, SQLValueType}; assert!(!ValueType::Instant.accommodates_integer(1493399581314)); assert!(!ValueType::Instant.accommodates_integer(1493399581314000)); assert!(ValueType::Boolean.accommodates_integer(1)); assert!(!ValueType::Boolean.accommodates_integer(-1)); assert!(!ValueType::Boolean.accommodates_integer(10)); assert!(!ValueType::String.accommodates_integer(10));
impl PartialOrd<ValueType> for ValueType
[src]
impl PartialOrd<ValueType> for ValueType
fn partial_cmp(&self, __arg_0: &ValueType) -> Option<Ordering>
[src]
fn partial_cmp(&self, __arg_0: &ValueType) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Copy for ValueType
[src]
impl Copy for ValueType
impl Clone for ValueType
[src]
impl Clone for ValueType
fn clone(&self) -> ValueType
[src]
fn clone(&self) -> ValueType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl From<ValueType> for ValueTypeSet
[src]
impl From<ValueType> for ValueTypeSet
fn from(t: ValueType) -> ValueTypeSet
[src]
fn from(t: ValueType) -> ValueTypeSet
Performs the conversion.
impl Ord for ValueType
[src]
impl Ord for ValueType
fn cmp(&self, __arg_0: &ValueType) -> Ordering
[src]
fn cmp(&self, __arg_0: &ValueType) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Extend<ValueType> for ValueTypeSet
[src]
impl Extend<ValueType> for ValueTypeSet
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = ValueType>,
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = ValueType>,
Extends a collection with the contents of an iterator. Read more
impl Hash for ValueType
[src]
impl Hash for ValueType
fn hash<__H>(&self, __arg_0: &mut __H) where
__H: Hasher,
[src]
fn hash<__H>(&self, __arg_0: &mut __H) where
__H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for ValueType
[src]
impl Eq for ValueType
impl PartialEq<ValueType> for ValueType
[src]
impl PartialEq<ValueType> for ValueType
fn eq(&self, __arg_0: &ValueType) -> bool
[src]
fn eq(&self, __arg_0: &ValueType) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl FromIterator<ValueType> for ValueTypeSet
[src]
impl FromIterator<ValueType> for ValueTypeSet
fn from_iter<I>(iterator: I) -> ValueTypeSet where
I: IntoIterator<Item = ValueType>,
[src]
fn from_iter<I>(iterator: I) -> ValueTypeSet where
I: IntoIterator<Item = ValueType>,
Creates a value from an iterator. Read more
impl Display for ValueType
[src]
impl Display for ValueType
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Debug for ValueType
[src]
impl Debug for ValueType
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl CLike for ValueType
[src]
impl CLike for ValueType