use std::ops::Range; use std::sync::Arc; use crate::{ColumnValues, RowId}; pub trait Iterable { fn boxed_iter(&self) -> Box + '_>; } impl Iterable for &[T] { fn boxed_iter(&self) -> Box + '_> { Box::new(self.iter().copied()) } } impl Iterable for Range where Range: Iterator { fn boxed_iter(&self) -> Box + '_> { Box::new(self.clone()) } } impl Iterable for Arc> { fn boxed_iter(&self) -> Box + '_> { Box::new(self.iter().map(|row_id| row_id as u64)) } }