Trait cassandra_cpp::LendingIterator
source · pub trait LendingIterator {
type Item<'a>
where Self: 'a;
// Required method
fn next(&mut self) -> Option<Self::Item<'_>>;
// Provided method
fn size_hint(&self) -> (usize, Option<usize>) { ... }
}
Expand description
Iterator that only allows access to a single item at a time. You must stop using the returned item before getting the next.
Ultimately we will move to use a common crate for this, but to date there is no good crate to follow. https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html#generic-associated-types-gats and https://github.com/Crazytieguy/gat-lending-iterator were references for this code.
The idiomatic way to work with this trait is as follows:
while let Some(row) = lending_iterator.next() {
// ... do something with `row` ...
}
Required Associated Types§
Required Methods§
Provided Methods§
Object Safety§
This trait is not object safe.