use crate::graph::PoolKind;
#[derive(Clone, Debug)]
pub struct SearchSpec {
pub start: u64,
pub end: u64,
pub min_depth: usize,
pub max_depth: Option<usize>,
pub include_reverse: bool,
pub pool_type_per_depth: Option<Vec<Option<Vec<PoolKind>>>>,
}
impl SearchSpec {
#[must_use]
pub fn new(
start: u64,
end: u64,
min_depth: usize,
max_depth: Option<usize>,
include_reverse: bool,
pool_type_per_depth: Option<Vec<Option<Vec<PoolKind>>>>,
) -> Self {
Self {
start,
end,
min_depth,
max_depth,
include_reverse,
pool_type_per_depth,
}
}
pub fn validate(&mut self) {
if let Some(filter) = &self.pool_type_per_depth {
let filter_len = filter.len();
self.max_depth = Some(match self.max_depth {
Some(md) => md.min(filter_len),
None => filter_len,
});
self.min_depth = self.min_depth.max(filter_len);
}
}
}