Enum core_traits::TypedValue
[−]
[src]
pub enum TypedValue { Ref(Entid), Boolean(bool), Long(i64), Double(OrderedFloat<f64>), Instant(DateTime<Utc>), String(ValueRc<String>), Keyword(ValueRc<Keyword>), Uuid(Uuid), }
Represents a value that can be stored in a Mentat store.
Variants
Ref(Entid)
Boolean(bool)
Long(i64)
Double(OrderedFloat<f64>)
Instant(DateTime<Utc>)
String(ValueRc<String>)
Keyword(ValueRc<Keyword>)
Uuid(Uuid)
Methods
impl TypedValue
[src]
pub fn is_congruent_with<T: Into<Option<ValueType>>>(&self, t: T) -> bool
[src]
Returns true if the provided type is Some
and matches this value's type, or if the
provided type is None
.
pub fn matches_type(&self, t: ValueType) -> bool
[src]
pub fn value_type(&self) -> ValueType
[src]
pub fn typed_ns_keyword<S: AsRef<str>, T: AsRef<str>>(
ns: S,
name: T
) -> TypedValue
[src]
ns: S,
name: T
) -> TypedValue
Construct a new TypedValue::Keyword
instance by cloning the provided
values and wrapping them in a new ValueRc
. This is expensive, so this might
be best limited to tests.
pub fn typed_string<S: AsRef<str>>(s: S) -> TypedValue
[src]
Construct a new TypedValue::String
instance by cloning the provided
value and wrapping it in a new ValueRc
. This is expensive, so this might
be best limited to tests.
pub fn current_instant() -> TypedValue
[src]
pub fn instant(micros: i64) -> TypedValue
[src]
Construct a new TypedValue::Instant
instance from the provided
microsecond timestamp.
pub fn into_known_entid(self) -> Option<KnownEntid>
[src]
pub fn into_entid(self) -> Option<Entid>
[src]
pub fn into_kw(self) -> Option<ValueRc<Keyword>>
[src]
pub fn into_boolean(self) -> Option<bool>
[src]
pub fn into_long(self) -> Option<i64>
[src]
pub fn into_double(self) -> Option<f64>
[src]
pub fn into_instant(self) -> Option<DateTime<Utc>>
[src]
pub fn into_timestamp(self) -> Option<i64>
[src]
pub fn into_string(self) -> Option<ValueRc<String>>
[src]
pub fn into_c_string(self) -> Option<*mut c_char>
[src]
pub fn into_kw_c_string(self) -> Option<*mut c_char>
[src]
pub fn into_uuid_c_string(self) -> Option<*mut c_char>
[src]
pub fn into_uuid(self) -> Option<Uuid>
[src]
pub fn into_uuid_string(self) -> Option<String>
[src]
Trait Implementations
impl TransactableValueMarker for TypedValue
[src]
TypedValue
is the value type for programmatic use in transaction builders.
impl Clone for TypedValue
[src]
fn clone(&self) -> TypedValue
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for TypedValue
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Eq for TypedValue
[src]
impl Hash for TypedValue
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Ord for TypedValue
[src]
fn cmp(&self, __arg_0: &TypedValue) -> Ordering
[src]
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
impl PartialOrd for TypedValue
[src]
fn partial_cmp(&self, __arg_0: &TypedValue) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &TypedValue) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &TypedValue) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &TypedValue) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &TypedValue) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq for TypedValue
[src]
fn eq(&self, __arg_0: &TypedValue) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TypedValue) -> bool
[src]
This method tests for !=
.
impl From<KnownEntid> for TypedValue
[src]
fn from(k: KnownEntid) -> TypedValue
[src]
Performs the conversion.
impl From<bool> for TypedValue
[src]
fn from(value: bool) -> TypedValue
[src]
Performs the conversion.
impl From<DateTime<Utc>> for TypedValue
[src]
Truncate the provided DateTime
to microsecond precision, and return the corresponding
TypedValue::Instant
.
fn from(value: DateTime<Utc>) -> TypedValue
[src]
Performs the conversion.
impl From<Uuid> for TypedValue
[src]
fn from(value: Uuid) -> TypedValue
[src]
Performs the conversion.
impl<'a> From<&'a str> for TypedValue
[src]
fn from(value: &'a str) -> TypedValue
[src]
Performs the conversion.
impl From<Arc<String>> for TypedValue
[src]
fn from(value: Arc<String>) -> TypedValue
[src]
Performs the conversion.
impl From<Rc<String>> for TypedValue
[src]
fn from(value: Rc<String>) -> TypedValue
[src]
Performs the conversion.
impl From<Box<String>> for TypedValue
[src]
fn from(value: Box<String>) -> TypedValue
[src]
Performs the conversion.
impl From<String> for TypedValue
[src]
fn from(value: String) -> TypedValue
[src]
Performs the conversion.
impl From<Arc<Keyword>> for TypedValue
[src]
fn from(value: Arc<Keyword>) -> TypedValue
[src]
Performs the conversion.
impl From<Rc<Keyword>> for TypedValue
[src]
fn from(value: Rc<Keyword>) -> TypedValue
[src]
Performs the conversion.
impl From<Keyword> for TypedValue
[src]
fn from(value: Keyword) -> TypedValue
[src]
Performs the conversion.
impl From<u32> for TypedValue
[src]
fn from(value: u32) -> TypedValue
[src]
Performs the conversion.
impl From<i32> for TypedValue
[src]
fn from(value: i32) -> TypedValue
[src]
Performs the conversion.
impl From<f64> for TypedValue
[src]
fn from(value: f64) -> TypedValue
[src]
Performs the conversion.