Enum core_traits::Binding
[−]
[src]
pub enum Binding { Scalar(TypedValue), Vec(ValueRc<Vec<Binding>>), Map(ValueRc<StructuredMap>), }
The values bound in a query specification can be:
- Vecs of structured values, for multi-valued component attributes or nested expressions.
- Single structured values, for single-valued component attributes or nested expressions.
- Single typed values, for simple attributes.
The Binding
enum defines these three options.
Datomic also supports structured inputs; at present Mentat does not, but this type would also serve that purpose.
Note that maps are not ordered, and so Binding
is neither Ord
nor PartialOrd
.
Variants
Scalar(TypedValue)
Vec(ValueRc<Vec<Binding>>)
Map(ValueRc<StructuredMap>)
Methods
impl Binding
[src]
pub fn into_scalar(self) -> Option<TypedValue>
[src]
pub fn into_vec(self) -> Option<ValueRc<Vec<Binding>>>
[src]
pub fn into_map(self) -> Option<ValueRc<StructuredMap>>
[src]
pub fn as_scalar(&self) -> Option<&TypedValue>
[src]
pub fn as_vec(&self) -> Option<&Vec<Binding>>
[src]
pub fn as_map(&self) -> Option<&StructuredMap>
[src]
impl Binding
[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) -> Option<ValueType>
[src]
impl Binding
[src]
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_uuid(self) -> Option<Uuid>
[src]
pub fn into_uuid_string(self) -> Option<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 as_entid(&self) -> Option<&Entid>
[src]
pub fn as_kw(&self) -> Option<&ValueRc<Keyword>>
[src]
pub fn as_boolean(&self) -> Option<&bool>
[src]
pub fn as_long(&self) -> Option<&i64>
[src]
pub fn as_double(&self) -> Option<&f64>
[src]
pub fn as_instant(&self) -> Option<&DateTime<Utc>>
[src]
pub fn as_string(&self) -> Option<&ValueRc<String>>
[src]
pub fn as_uuid(&self) -> Option<&Uuid>
[src]
Trait Implementations
impl Clone for Binding
[src]
fn clone(&self) -> Binding
[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 Binding
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Eq for Binding
[src]
impl PartialEq for Binding
[src]
fn eq(&self, __arg_0: &Binding) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Binding) -> bool
[src]
This method tests for !=
.
impl<T> From<T> for Binding where
T: Into<TypedValue>,
[src]
T: Into<TypedValue>,
impl From<StructuredMap> for Binding
[src]
fn from(value: StructuredMap) -> Self
[src]
Performs the conversion.