Enum mentat_core::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

Methods

impl ValueType
[src]

impl ValueType
[src]

Trait Implementations

impl Clone for ValueType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for ValueType
[src]

impl Debug for ValueType
[src]

Formats the value using the given formatter. Read more

impl Eq for ValueType
[src]

impl Hash for ValueType
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for ValueType
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd for ValueType
[src]

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

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PartialEq for ValueType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl CLike for ValueType
[src]

Converts a C-like enum to a u32. The value must be <= 31.

Converts a u32 to a C-like enum. This method only needs to be safe for possible return values of to_u32 of this trait. Read more

impl Display for ValueType
[src]

Formats the value using the given formatter. Read more

impl From<ValueType> for ValueTypeSet
[src]

Performs the conversion.

impl FromIterator<ValueType> for ValueTypeSet
[src]

Creates a value from an iterator. Read more

impl Extend<ValueType> for ValueTypeSet
[src]

Extends a collection with the contents of an iterator. Read more

impl SQLValueType for ValueType
[src]

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

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));

Auto Trait Implementations

impl Send for ValueType

impl Sync for ValueType