pub enum Binding {
Scalar(TypedValue),
Vec(Arc<Vec<Binding>>),
Map(Arc<StructuredMap>),
}Expand description
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§
Implementations§
Source§impl Binding
impl Binding
pub fn into_scalar(self) -> Option<TypedValue>
pub fn into_vec(self) -> Option<Arc<Vec<Binding>>>
pub fn into_map(self) -> Option<Arc<StructuredMap>>
pub fn as_scalar(&self) -> Option<&TypedValue>
pub fn as_vec(&self) -> Option<&Vec<Binding>>
pub fn as_map(&self) -> Option<&StructuredMap>
Source§impl Binding
impl Binding
Sourcepub fn is_congruent_with<T>(&self, t: T) -> bool
pub fn is_congruent_with<T>(&self, t: T) -> bool
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
pub fn value_type(&self) -> Option<ValueType>
Source§impl Binding
impl Binding
pub fn into_known_entid(self) -> Option<KnownEntid>
pub fn into_entid(self) -> Option<i64>
pub fn into_kw(self) -> Option<Arc<Keyword>>
pub fn into_boolean(self) -> Option<bool>
pub fn into_long(self) -> Option<i64>
pub fn into_double(self) -> Option<f64>
pub fn into_instant(self) -> Option<DateTime<Utc>>
pub fn into_timestamp(self) -> Option<i64>
pub fn into_string(self) -> Option<Arc<String>>
pub fn into_uuid(self) -> Option<Uuid>
pub fn into_uuid_string(self) -> Option<String>
pub fn into_c_string(self) -> Option<*mut i8>
pub fn into_kw_c_string(self) -> Option<*mut i8>
pub fn into_uuid_c_string(self) -> Option<*mut i8>
pub fn as_entid(&self) -> Option<&i64>
pub fn as_kw(&self) -> Option<&Arc<Keyword>>
pub fn as_boolean(&self) -> Option<&bool>
pub fn as_long(&self) -> Option<&i64>
pub fn as_double(&self) -> Option<&f64>
pub fn as_instant(&self) -> Option<&DateTime<Utc>>
pub fn as_string(&self) -> Option<&Arc<String>>
pub fn as_uuid(&self) -> Option<&Uuid>
Trait Implementations§
impl Eq for Binding
Source§impl From<StructuredMap> for Binding
impl From<StructuredMap> for Binding
Source§fn from(value: StructuredMap) -> Binding
fn from(value: StructuredMap) -> Binding
Converts to this type from the input type.
impl StructuralPartialEq for Binding
Auto Trait Implementations§
impl !Freeze for Binding
impl RefUnwindSafe for Binding
impl Send for Binding
impl Sync for Binding
impl Unpin for Binding
impl UnsafeUnpin for Binding
impl UnwindSafe for Binding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more