fuel_core_storage::iter

Trait IteratorOverTable

source
pub trait IteratorOverTable {
    // Provided methods
    fn iter_all_keys<M>(
        &self,
        direction: Option<IterDirection>,
    ) -> BoxedIter<'_, Result<M::OwnedKey>> 
       where M: Mappable,
             Self: IterableTable<M> { ... }
    fn iter_all_by_prefix_keys<M, P>(
        &self,
        prefix: Option<P>,
    ) -> BoxedIter<'_, Result<M::OwnedKey>> 
       where M: Mappable,
             P: AsRef<[u8]>,
             Self: IterableTable<M> { ... }
    fn iter_all_by_start_keys<M>(
        &self,
        start: Option<&M::Key>,
        direction: Option<IterDirection>,
    ) -> BoxedIter<'_, Result<M::OwnedKey>> 
       where M: Mappable,
             Self: IterableTable<M> { ... }
    fn iter_all_filtered_keys<M, P>(
        &self,
        prefix: Option<P>,
        start: Option<&M::Key>,
        direction: Option<IterDirection>,
    ) -> BoxedIter<'_, Result<M::OwnedKey>> 
       where M: Mappable,
             P: AsRef<[u8]>,
             Self: IterableTable<M> { ... }
    fn iter_all<M>(
        &self,
        direction: Option<IterDirection>,
    ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>> 
       where M: Mappable,
             Self: IterableTable<M> { ... }
    fn iter_all_by_prefix<M, P>(
        &self,
        prefix: Option<P>,
    ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>> 
       where M: Mappable,
             P: AsRef<[u8]>,
             Self: IterableTable<M> { ... }
    fn iter_all_by_start<M>(
        &self,
        start: Option<&M::Key>,
        direction: Option<IterDirection>,
    ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>> 
       where M: Mappable,
             Self: IterableTable<M> { ... }
    fn iter_all_filtered<M, P>(
        &self,
        prefix: Option<P>,
        start: Option<&M::Key>,
        direction: Option<IterDirection>,
    ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>> 
       where M: Mappable,
             P: AsRef<[u8]>,
             Self: IterableTable<M> { ... }
}
Expand description

A helper trait to provide a user-friendly API over table iteration.

Provided Methods§

source

fn iter_all_keys<M>( &self, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<M::OwnedKey>>
where M: Mappable, Self: IterableTable<M>,

Returns an iterator over the all keys in the table.

source

fn iter_all_by_prefix_keys<M, P>( &self, prefix: Option<P>, ) -> BoxedIter<'_, Result<M::OwnedKey>>
where M: Mappable, P: AsRef<[u8]>, Self: IterableTable<M>,

Returns an iterator over the all keys in the table with the specified prefix.

source

fn iter_all_by_start_keys<M>( &self, start: Option<&M::Key>, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<M::OwnedKey>>
where M: Mappable, Self: IterableTable<M>,

Returns an iterator over the all keys in the table after a specific start key.

source

fn iter_all_filtered_keys<M, P>( &self, prefix: Option<P>, start: Option<&M::Key>, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<M::OwnedKey>>
where M: Mappable, P: AsRef<[u8]>, Self: IterableTable<M>,

Returns an iterator over the all keys in the table with a prefix after a specific start key.

source

fn iter_all<M>( &self, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>>
where M: Mappable, Self: IterableTable<M>,

Returns an iterator over the all entries in the table.

source

fn iter_all_by_prefix<M, P>( &self, prefix: Option<P>, ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>>
where M: Mappable, P: AsRef<[u8]>, Self: IterableTable<M>,

Returns an iterator over the all entries in the table with the specified prefix.

source

fn iter_all_by_start<M>( &self, start: Option<&M::Key>, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>>
where M: Mappable, Self: IterableTable<M>,

Returns an iterator over the all entries in the table after a specific start key.

source

fn iter_all_filtered<M, P>( &self, prefix: Option<P>, start: Option<&M::Key>, direction: Option<IterDirection>, ) -> BoxedIter<'_, Result<(M::OwnedKey, M::OwnedValue)>>
where M: Mappable, P: AsRef<[u8]>, Self: IterableTable<M>,

Returns an iterator over the all entries in the table with a prefix after a specific start key.

Object Safety§

This trait is not object safe.

Implementors§