#![allow(dead_code)]
#[derive(Debug, Clone, Default)]
pub struct SearchFilters {
pub tools: Vec<String>,
pub errors_only: bool,
pub project: Option<String>,
}
impl SearchFilters {
pub fn new() -> Self {
Self::default()
}
pub fn with_tools(mut self, tools: Vec<String>) -> Self {
self.tools = tools;
self
}
pub fn with_errors_only(mut self, errors_only: bool) -> Self {
self.errors_only = errors_only;
self
}
pub fn with_project(mut self, project: String) -> Self {
self.project = Some(project);
self
}
pub fn is_empty(&self) -> bool {
self.tools.is_empty() && !self.errors_only && self.project.is_none()
}
}