Enum mentat_ffi::TypedValue
[−]
[src]
pub enum TypedValue { Ref(i64), Boolean(bool), Long(i64), Double(OrderedFloat<f64>), Instant(DateTime<Utc>), String(Arc<String>), Keyword(Arc<Keyword>), Uuid(Uuid), }
Represents a value that can be stored in a Mentat store.
Variants
Ref(i64)
Boolean(bool)
Long(i64)
Double(OrderedFloat<f64>)
Instant(DateTime<Utc>)
String(Arc<String>)
Keyword(Arc<Keyword>)
Uuid(Uuid)
Methods
impl TypedValue
[src]
impl TypedValue
pub fn is_congruent_with<T>(&self, t: T) -> bool where
T: Into<Option<ValueType>>,
[src]
pub fn is_congruent_with<T>(&self, t: T) -> bool where
T: Into<Option<ValueType>>,
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 matches_type(&self, t: ValueType) -> bool
pub fn value_type(&self) -> ValueType
[src]
pub fn value_type(&self) -> ValueType
pub fn typed_ns_keyword(ns: &str, name: &str) -> TypedValue
[src]
pub fn typed_ns_keyword(ns: &str, name: &str) -> 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: &str) -> TypedValue
[src]
pub fn typed_string(s: &str) -> TypedValue
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 current_instant() -> TypedValue
pub fn instant(micros: i64) -> TypedValue
[src]
pub fn instant(micros: i64) -> TypedValue
Construct a new TypedValue::Instant
instance from the provided
microsecond timestamp.
impl TypedValue
[src]
impl TypedValue
pub fn into_known_entid(self) -> Option<KnownEntid>
[src]
pub fn into_known_entid(self) -> Option<KnownEntid>
pub fn into_entid(self) -> Option<i64>
[src]
pub fn into_entid(self) -> Option<i64>
pub fn into_kw(self) -> Option<Arc<Keyword>>
[src]
pub fn into_kw(self) -> Option<Arc<Keyword>>
pub fn into_boolean(self) -> Option<bool>
[src]
pub fn into_boolean(self) -> Option<bool>
pub fn into_long(self) -> Option<i64>
[src]
pub fn into_long(self) -> Option<i64>
pub fn into_double(self) -> Option<f64>
[src]
pub fn into_double(self) -> Option<f64>
pub fn into_instant(self) -> Option<DateTime<Utc>>
[src]
pub fn into_instant(self) -> Option<DateTime<Utc>>
pub fn into_timestamp(self) -> Option<i64>
[src]
pub fn into_timestamp(self) -> Option<i64>
pub fn into_string(self) -> Option<Arc<String>>
[src]
pub fn into_string(self) -> Option<Arc<String>>
pub fn into_c_string(self) -> Option<*mut i8>
[src]
pub fn into_c_string(self) -> Option<*mut i8>
pub fn into_kw_c_string(self) -> Option<*mut i8>
[src]
pub fn into_kw_c_string(self) -> Option<*mut i8>
pub fn into_uuid_c_string(self) -> Option<*mut i8>
[src]
pub fn into_uuid_c_string(self) -> Option<*mut i8>
pub fn into_uuid(self) -> Option<Uuid>
[src]
pub fn into_uuid(self) -> Option<Uuid>
pub fn into_uuid_string(self) -> Option<String>
[src]
pub fn into_uuid_string(self) -> Option<String>
Trait Implementations
impl FromThing<TypedValue> for Either<TypedValue, Rc<TempId>>
[src]
impl FromThing<TypedValue> for Either<TypedValue, Rc<TempId>>
fn from_thing(v: TypedValue) -> Either<TypedValue, Rc<TempId>>
[src]
fn from_thing(v: TypedValue) -> Either<TypedValue, Rc<TempId>>
impl PartialOrd<TypedValue> for TypedValue
[src]
impl PartialOrd<TypedValue> for TypedValue
fn partial_cmp(&self, __arg_0: &TypedValue) -> Option<Ordering>
[src]
fn partial_cmp(&self, __arg_0: &TypedValue) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &TypedValue) -> bool
[src]
fn lt(&self, __arg_0: &TypedValue) -> bool
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]
fn le(&self, __arg_0: &TypedValue) -> bool
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]
fn gt(&self, __arg_0: &TypedValue) -> bool
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]
fn ge(&self, __arg_0: &TypedValue) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Clone for TypedValue
[src]
impl Clone for TypedValue
fn clone(&self) -> TypedValue
[src]
fn clone(&self) -> TypedValue
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<'a> From<&'a str> for TypedValue
[src]
impl<'a> From<&'a str> for TypedValue
fn from(value: &'a str) -> TypedValue
[src]
fn from(value: &'a str) -> TypedValue
Performs the conversion.
impl From<bool> for TypedValue
[src]
impl From<bool> for TypedValue
fn from(value: bool) -> TypedValue
[src]
fn from(value: bool) -> TypedValue
Performs the conversion.
impl From<Uuid> for TypedValue
[src]
impl From<Uuid> for TypedValue
fn from(value: Uuid) -> TypedValue
[src]
fn from(value: Uuid) -> TypedValue
Performs the conversion.
impl From<Box<String>> for TypedValue
[src]
impl From<Box<String>> for TypedValue
fn from(value: Box<String>) -> TypedValue
[src]
fn from(value: Box<String>) -> TypedValue
Performs the conversion.
impl From<u32> for TypedValue
[src]
impl From<u32> for TypedValue
fn from(value: u32) -> TypedValue
[src]
fn from(value: u32) -> TypedValue
Performs the conversion.
impl From<Rc<Keyword>> for TypedValue
[src]
impl From<Rc<Keyword>> for TypedValue
fn from(value: Rc<Keyword>) -> TypedValue
[src]
fn from(value: Rc<Keyword>) -> TypedValue
Performs the conversion.
impl From<Arc<String>> for TypedValue
[src]
impl From<Arc<String>> for TypedValue
fn from(value: Arc<String>) -> TypedValue
[src]
fn from(value: Arc<String>) -> TypedValue
Performs the conversion.
impl From<KnownEntid> for TypedValue
[src]
impl From<KnownEntid> for TypedValue
fn from(k: KnownEntid) -> TypedValue
[src]
fn from(k: KnownEntid) -> TypedValue
Performs the conversion.
impl From<f64> for TypedValue
[src]
impl From<f64> for TypedValue
fn from(value: f64) -> TypedValue
[src]
fn from(value: f64) -> TypedValue
Performs the conversion.
impl From<Keyword> for TypedValue
[src]
impl From<Keyword> for TypedValue
fn from(value: Keyword) -> TypedValue
[src]
fn from(value: Keyword) -> TypedValue
Performs the conversion.
impl From<DateTime<Utc>> for TypedValue
[src]
impl From<DateTime<Utc>> for TypedValue
Truncate the provided DateTime
to microsecond precision, and return the corresponding
TypedValue::Instant
.
fn from(value: DateTime<Utc>) -> TypedValue
[src]
fn from(value: DateTime<Utc>) -> TypedValue
Performs the conversion.
impl From<i32> for TypedValue
[src]
impl From<i32> for TypedValue
fn from(value: i32) -> TypedValue
[src]
fn from(value: i32) -> TypedValue
Performs the conversion.
impl From<String> for TypedValue
[src]
impl From<String> for TypedValue
fn from(value: String) -> TypedValue
[src]
fn from(value: String) -> TypedValue
Performs the conversion.
impl From<Arc<Keyword>> for TypedValue
[src]
impl From<Arc<Keyword>> for TypedValue
fn from(value: Arc<Keyword>) -> TypedValue
[src]
fn from(value: Arc<Keyword>) -> TypedValue
Performs the conversion.
impl From<Rc<String>> for TypedValue
[src]
impl From<Rc<String>> for TypedValue
fn from(value: Rc<String>) -> TypedValue
[src]
fn from(value: Rc<String>) -> TypedValue
Performs the conversion.
impl Ord for TypedValue
[src]
impl Ord for TypedValue
fn cmp(&self, __arg_0: &TypedValue) -> Ordering
[src]
fn cmp(&self, __arg_0: &TypedValue) -> 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<'de> Deserialize<'de> for TypedValue
[src]
impl<'de> Deserialize<'de> for TypedValue
fn deserialize<__D>(
__deserializer: __D
) -> Result<TypedValue, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<TypedValue, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Hash for TypedValue
[src]
impl Hash for TypedValue
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 TypedValue
[src]
impl Eq for TypedValue
impl PartialEq<TypedValue> for TypedValue
[src]
impl PartialEq<TypedValue> for TypedValue
fn eq(&self, __arg_0: &TypedValue) -> bool
[src]
fn eq(&self, __arg_0: &TypedValue) -> bool
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]
fn ne(&self, __arg_0: &TypedValue) -> bool
This method tests for !=
.
impl Debug for TypedValue
[src]
impl Debug for TypedValue
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 Serialize for TypedValue
[src]
impl Serialize for TypedValue
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl TypedSQLValue for TypedValue
[src]
impl TypedSQLValue for TypedValue
fn from_sql_value_pair(
value: Value,
value_type_tag: i32
) -> Result<TypedValue, DbError>
[src]
fn from_sql_value_pair(
value: Value,
value_type_tag: i32
) -> Result<TypedValue, DbError>
Given a SQLite value
and a value_type_tag
, return the corresponding TypedValue
.
fn from_edn_value(value: &Value) -> Option<TypedValue>
[src]
fn from_edn_value(value: &Value) -> Option<TypedValue>
Given an EDN value
, return a corresponding Mentat TypedValue
.
An EDN Value
does not encode a unique Mentat ValueType
, so the composition
from_edn_value(first(to_edn_value_pair(...)))
loses information. Additionally, there are
EDN values which are not Mentat typed values.
This function is deterministic.
fn to_sql_value_pair(&'a self) -> (ToSqlOutput<'a>, i32)
[src]
fn to_sql_value_pair(&'a self) -> (ToSqlOutput<'a>, i32)
Return the corresponding SQLite value
and value_type_tag
pair.
fn to_edn_value_pair(&self) -> (Value, ValueType)
[src]
fn to_edn_value_pair(&self) -> (Value, ValueType)
Return the corresponding EDN value
and value_type
pair.
impl TransactableValue for TypedValue
[src]
impl TransactableValue for TypedValue
fn into_typed_value(
self,
_schema: &Schema,
value_type: ValueType
) -> Result<TypedValue, DbError>
[src]
fn into_typed_value(
self,
_schema: &Schema,
value_type: ValueType
) -> Result<TypedValue, DbError>
Coerce this value place into the given type. This is where we perform schema-aware coercion, for example coercing an integral value into a ref where appropriate. Read more
fn into_entity_place(self) -> Result<EntityPlace<TypedValue>, DbError>
[src]
fn into_entity_place(self) -> Result<EntityPlace<TypedValue>, DbError>
Make an entity place out of this value place. This is where we limit values in nested maps to valid entity places. Read more
fn as_tempid(&self) -> Option<TempId>
[src]
fn as_tempid(&self) -> Option<TempId>
Auto Trait Implementations
impl Send for TypedValue
impl Send for TypedValue
impl Sync for TypedValue
impl Sync for TypedValue