use std::num::NonZeroU64;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(super) struct IterationSampling(NonZeroU64);
impl IterationSampling {
pub(super) const EVERY: Self = Self(NonZeroU64::MIN);
pub(super) const fn new(iterations: NonZeroU64) -> Self {
Self(iterations)
}
pub(super) const fn get(self) -> u64 {
self.0.get()
}
pub(super) const fn includes(self, iteration: u64) -> bool {
iteration.is_multiple_of(self.get())
}
}