Trait matterdb::access::AccessExt[][src]

pub trait AccessExt: Access {
    fn get_group<K: ?Sized, I>(
        &self,
        name: impl Into<String>
    ) -> Group<Self, K, I>
    where
        K: BinaryKey,
        I: FromAccess<Self>
, { ... }
fn get_entry<I, V>(&self, addr: I) -> Entry<Self::Base, V>
    where
        I: Into<IndexAddress>,
        V: BinaryValue
, { ... }
fn get_list<I, V>(&self, addr: I) -> ListIndex<Self::Base, V>
    where
        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
, { ... }
fn get_sparse_list<I, V>(&self, addr: I) -> SparseListIndex<Self::Base, V>
    where
        I: Into<IndexAddress>,
        V: BinaryValue
, { ... }
fn get_key_set<I, K: ?Sized>(&self, addr: I) -> KeySetIndex<Self::Base, K>
    where
        I: Into<IndexAddress>,
        K: BinaryKey
, { ... }
fn index_type<I>(&self, addr: I) -> Option<IndexType>
    where
        I: Into<IndexAddress>
, { ... } }

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]

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]

Gets an entry index with the specified address.

Panics

If the index exists, but is not an entry.

fn get_list<I, V>(&self, addr: I) -> ListIndex<Self::Base, V> where
    I: Into<IndexAddress>,
    V: BinaryValue
[src]

Gets a list index with the specified address.

Panics

If the index exists, but is not a list.

fn get_map<I, K: ?Sized, V>(&self, addr: I) -> MapIndex<Self::Base, K, V> where
    I: Into<IndexAddress>,
    K: BinaryKey,
    V: BinaryValue
[src]

Gets a map index with the specified address.

Panics

If the index exists, but is not a map.

fn get_sparse_list<I, V>(&self, addr: I) -> SparseListIndex<Self::Base, V> where
    I: Into<IndexAddress>,
    V: BinaryValue
[src]

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]

Gets a key set index with the specified address.

Panics

If the index exists, but is not a key set.

fn index_type<I>(&self, addr: I) -> Option<IndexType> where
    I: Into<IndexAddress>, 
[src]

Gets index type at the specified address, or None if there is no index.

Loading content...

Implementors

impl<T: Access> AccessExt for T[src]

Loading content...