#[derive(Clone, Debug)]
pub struct ScanParams {
pub(crate) compute_full_matches: bool,
pub(crate) match_max_length: usize,
pub(crate) string_max_nb_matches: usize,
}
impl Default for ScanParams {
fn default() -> Self {
Self {
compute_full_matches: false,
match_max_length: 512,
string_max_nb_matches: 1_000,
}
}
}
impl ScanParams {
#[must_use]
pub fn compute_full_matches(mut self, compute_full_matches: bool) -> Self {
self.compute_full_matches = compute_full_matches;
self
}
#[must_use]
pub fn match_max_length(mut self, match_max_length: usize) -> Self {
self.match_max_length = match_max_length;
self
}
#[must_use]
pub fn string_max_nb_matches(mut self, string_max_nb_matches: usize) -> Self {
self.string_max_nb_matches = string_max_nb_matches;
self
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::test_helpers::test_type_traits;
#[test]
fn test_types_traits() {
test_type_traits(ScanParams::default());
}
}