#[derive(Debug, PartialEq)]
pub enum Select {
Query,
Preselect,
None,
}
impl Select {
pub fn is_selected(&self) -> bool {
self != &Select::None
}
}
#[derive(Debug, PartialEq)]
pub struct SelectStream {
stream: Vec<Select>,
}
impl SelectStream {
pub fn new() -> Self {
Self { stream: Vec::new() }
}
pub fn push(&mut self, selection: Select) {
self.stream.push(selection);
}
pub fn iter(&self) -> std::slice::Iter<'_, Select> {
self.stream.iter()
}
}
impl Default for SelectStream {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod test {
use super::SelectStream;
#[test]
fn default() {
assert_eq!(SelectStream::new(), SelectStream::default())
}
}