refactor backend module

This commit is contained in:
steven-omaha
2023-01-12 23:16:31 +01:00
parent b5d58e6656
commit c8c6ceabc7
6 changed files with 115 additions and 106 deletions
+21
View File
@@ -0,0 +1,21 @@
use super::{Backend, Backends};
#[derive(Debug)]
pub(crate) struct BackendIter {
pub(crate) next: Option<Backends>,
}
impl Iterator for BackendIter {
type Item = Box<dyn Backend>;
fn next(&mut self) -> Option<Self::Item> {
match &self.next {
None => None,
Some(b) => {
let result = b.get_backend();
self.next = b.next();
Some(result)
}
}
}
}