use super::AdjacencyIterator;
use crate::backend::native::types::*;
impl<'a> Iterator for AdjacencyIterator<'a> {
type Item = NativeNodeId;
#[inline(always)]
fn next(&mut self) -> Option<Self::Item> {
if self.is_complete() {
return None;
}
match self.get_current_neighbor() {
Ok(Some(neighbor)) => {
self.current_index += 1;
Some(neighbor)
}
Ok(None) => {
None
}
Err(_) => {
None
}
}
}
fn size_hint(&self) -> (usize, Option<usize>) {
let remaining = (self.total_count - self.current_index) as usize;
(remaining, Some(remaining))
}
}