Struct core_traits::StructuredMap
[−]
[src]
pub struct StructuredMap(pub IndexMap<ValueRc<Keyword>, Binding>);
A pull expression expands a binding into a structure. The returned structure
associates attributes named in the input or retrieved from the store with values.
This association is a StructuredMap
.
Note that 'attributes' in Datomic's case can mean:
- Reversed attribute keywords (:artist/_country).
- An alias using
:as
(:artist/name :as "Band name").
We entirely support the former, and partially support the latter -- you can alias using a different keyword only.
Methods
impl StructuredMap
[src]
pub fn insert<N, B>(&mut self, name: N, value: B) where
N: Into<ValueRc<Keyword>>,
B: Into<Binding>,
[src]
N: Into<ValueRc<Keyword>>,
B: Into<Binding>,
Methods from Deref<Target = IndexMap<ValueRc<Keyword>, Binding>>
pub fn len(&self) -> usize
[src]
Return the number of key-value pairs in the map.
Computes in O(1) time.
pub fn is_empty(&self) -> bool
[src]
Returns true if the map contains no elements.
Computes in O(1) time.
ⓘImportant traits for &'a mut Rpub fn hasher(&self) -> &S where
S: BuildHasher,
[src]
S: BuildHasher,
Return a reference to the map's BuildHasher
.
pub fn capacity(&self) -> usize
[src]
Computes in O(1) time.
ⓘImportant traits for Iter<'a, K, V>pub fn iter(&self) -> Iter<K, V>
[src]
Return an iterator over the key-value pairs of the map, in their order
ⓘImportant traits for Keys<'a, K, V>pub fn keys(&self) -> Keys<K, V>
[src]
Return an iterator over the keys of the map, in their order
ⓘImportant traits for Values<'a, K, V>pub fn values(&self) -> Values<K, V>
[src]
Return an iterator over the values of the map, in their order
pub fn contains_key<Q>(&self, key: &Q) -> bool where
Q: Hash + Equivalent<K> + ?Sized,
[src]
Q: Hash + Equivalent<K> + ?Sized,
Return true
if an equivalent to key
exists in the map.
Computes in O(1) time (average).
pub fn get<Q>(&self, key: &Q) -> Option<&V> where
Q: Hash + Equivalent<K> + ?Sized,
[src]
Q: Hash + Equivalent<K> + ?Sized,
Return a reference to the value stored for key
, if it is present,
else None
.
Computes in O(1) time (average).
pub fn get_full<Q>(&self, key: &Q) -> Option<(usize, &K, &V)> where
Q: Hash + Equivalent<K> + ?Sized,
[src]
Q: Hash + Equivalent<K> + ?Sized,
Return item index, key and value
pub fn get_index(&self, index: usize) -> Option<(&K, &V)>
[src]
Get a key-value pair by index
Valid indices are 0 <= index < self.len()
Computes in O(1) time.
Trait Implementations
impl From<StructuredMap> for Binding
[src]
fn from(value: StructuredMap) -> Self
[src]
Performs the conversion.
impl Clone for StructuredMap
[src]
fn clone(&self) -> StructuredMap
[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 StructuredMap
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for StructuredMap
[src]
fn default() -> StructuredMap
[src]
Returns the "default value" for a type. Read more
impl Eq for StructuredMap
[src]
impl PartialEq for StructuredMap
[src]
fn eq(&self, __arg_0: &StructuredMap) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &StructuredMap) -> bool
[src]
This method tests for !=
.
impl Deref for StructuredMap
[src]
type Target = IndexMap<ValueRc<Keyword>, Binding>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl From<IndexMap<ValueRc<Keyword>, Binding>> for StructuredMap
[src]
impl<T> From<Vec<(Keyword, T)>> for StructuredMap where
T: Into<Binding>,
[src]
T: Into<Binding>,