pub struct Keys { /* private fields */ }key-value only.Expand description
A streaming list of keys from a key-value store.
Keys are returned as a stream, allowing you to process them incrementally
without loading the entire key set into memory. Use Keys::next() to
retrieve keys one at a time, or Keys::collect() to gather all keys
into a Vec.
After consuming the stream, you must check Keys::result() to
determine whether the operation completed successfully.
Implementations§
Source§impl Keys
impl Keys
Sourcepub async fn next(&mut self) -> Option<String>
pub async fn next(&mut self) -> Option<String>
Gets the next key from the stream.
Returns None when there are no more keys available. You must
await Keys::result() after the stream is exhausted to determine
if all keys were read successfully.
Sourcepub async fn result(self) -> Result<(), Error>
pub async fn result(self) -> Result<(), Error>
Whether the key listing completed successfully or with an error.
This must be called after the stream has been fully consumed to check for errors that may have occurred during streaming.
Sourcepub async fn collect(self) -> Result<Vec<String>, Error>
pub async fn collect(self) -> Result<Vec<String>, Error>
Collects all keys into a Vec.
This is a convenience method for when the key set is small enough to fit in memory and you do not require streaming behaviour.
Sourcepub fn into_inner(
self,
) -> (StreamReader<String>, FutureReader<Result<(), Error>>)
pub fn into_inner( self, ) -> (StreamReader<String>, FutureReader<Result<(), Error>>)
Extracts the underlying Wasm Component Model stream and future.