#[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.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given [Hasher
]. Read more
Feeds a slice of this type into the given [Hasher
]. Read more
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self | 1.21.0 [src] |
[−]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self | 1.21.0 [src] |
[−]
Compares and returns the minimum of two values. Read more
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
This method tests for self
and other
values to be equal, and is used by ==
. Read more
[−]
This method tests for !=
.
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
Formats the value using the given formatter. Read more
Extends a collection with the contents of an iterator. Read more
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));