pipecircuit 0.0.22

Correct. Robust. Fast. Portable. Pick four.
Documentation
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub struct EvidenceHighWaterMark {
    maximum: u64,
}

impl EvidenceHighWaterMark {
    pub const fn new() -> Self {
        Self { maximum: 0 }
    }

    pub const fn starting_at(maximum: u64) -> Self {
        Self { maximum }
    }

    pub const fn maximum(self) -> u64 {
        self.maximum
    }

    pub fn observe(&mut self, candidate: u64) {
        self.maximum = self.maximum.max(candidate);
    }

    pub fn observe_usize(&mut self, candidate: usize) {
        self.observe(candidate as u64);
    }

    pub fn reset(&mut self) {
        *self = Self::new();
    }
}