#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct PosSpec {
pub rank: i64,
pub count: Option<usize>,
pub max_len: Option<usize>,
}
impl PosSpec {
#[inline]
pub const fn new() -> Self {
Self {
rank: 1,
count: None,
max_len: None,
}
}
#[inline]
pub const fn with_rank(mut self, rank: i64) -> Self {
self.rank = rank;
self
}
#[inline]
pub const fn with_count(mut self, count: usize) -> Self {
self.count = Some(count);
self
}
#[inline]
pub const fn with_max_len(mut self, max_len: usize) -> Self {
self.max_len = Some(max_len);
self
}
}
impl Default for PosSpec {
#[inline]
fn default() -> Self {
Self::new()
}
}