Trait matterdb::access::AccessExt [−][src]
Extension trait allowing for easy access to indexes from any type implementing
Access
.
Implementation details
This trait is essentially a thin wrapper around FromAccess
. Where FromAccess
returns
an access error, the methods of this trait will unwrap()
the error and panic.
For a version on AccessExt
traits designed for Copy
types (e.g. &Fork
and
&dyn Snapshot
) see CopyAccessExt
trait.
Provided methods
fn get_group<K: ?Sized, I>(&self, name: impl Into<String>) -> Group<Self, K, I> where
K: BinaryKey,
I: FromAccess<Self>,
[src]
K: BinaryKey,
I: FromAccess<Self>,
Returns a group of indexes. All indexes in the group have the same type. Indexes are initialized lazily; i.e., no initialization is performed when the group is created.
Note that unlike other methods, this one requires address to be a string. This is to prevent collisions among groups.
fn get_entry<I, V>(&self, addr: I) -> Entry<Self::Base, V> where
I: Into<IndexAddress>,
V: BinaryValue,
[src]
I: Into<IndexAddress>,
V: BinaryValue,
fn get_list<I, V>(&self, addr: I) -> ListIndex<Self::Base, V> where
I: Into<IndexAddress>,
V: BinaryValue,
[src]
I: Into<IndexAddress>,
V: BinaryValue,
fn get_map<I, K: ?Sized, V>(&self, addr: I) -> MapIndex<Self::Base, K, V> where
I: Into<IndexAddress>,
K: BinaryKey,
V: BinaryValue,
[src]
I: Into<IndexAddress>,
K: BinaryKey,
V: BinaryValue,
fn get_sparse_list<I, V>(&self, addr: I) -> SparseListIndex<Self::Base, V> where
I: Into<IndexAddress>,
V: BinaryValue,
[src]
I: Into<IndexAddress>,
V: BinaryValue,
Gets a sparse list index with the specified address.
Panics
If the index exists, but is not a sparse list.
fn get_key_set<I, K: ?Sized>(&self, addr: I) -> KeySetIndex<Self::Base, K> where
I: Into<IndexAddress>,
K: BinaryKey,
[src]
I: Into<IndexAddress>,
K: BinaryKey,
fn index_type<I>(&self, addr: I) -> Option<IndexType> where
I: Into<IndexAddress>,
[src]
I: Into<IndexAddress>,
Gets index type at the specified address, or None
if there is no index.