refactor backend module
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user