pub trait Iterator {
    // Required methods
    fn next<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn error<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn key<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<&[u8]>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn value<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<&[u8]>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn release<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Required Methods§

source

fn next<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Attempts to move the iterator to the next key/value pair. It returns whether the iterator successfully moved to a new key/value pair. The iterator may return false if the underlying database has been closed before the iteration has completed, in which case future calls to Error() must return ErrorKind::Other, “database closed”)

source

fn error<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns any accumulated error. Exhausting all the key/value pairs is not considered to be an error. Error should be called after all key/value pairs have been exhausted ie. after Next() has returned false.

source

fn key<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&[u8]>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the key of the current key/value pair, or empty slice if done.

source

fn value<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&[u8]>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the key of the current k&ey/value pair, or empty slice if done.

source

fn release<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Releases associated resources. Release should always succeed and can be called multiple times without causing error.

Implementors§

source§

impl Iterator for avalanche_types::subnet::rpc::database::memdb::iterator::Iterator

source§

impl Iterator for avalanche_types::subnet::rpc::database::nodb::Iterator

source§

impl Iterator for avalanche_types::subnet::rpc::database::rpcdb::client::iterator::Iterator

source§

impl Iterator for avalanche_types::subnet::rpc::database::versiondb::iterator::Iterator