servlet 1.2.0

A small application runtime with an explicit operational contract
Documentation
//! Registration failures never echo metric names or label values.

/// Failure to define or encode an application instrument.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum MetricError {
    /// Invalid name, help, label schema, or histogram bounds.
    InvalidDefinition,
    /// An existing instrument owns one of the generated sample names.
    NameConflict,
    /// The finite definition, family, or series allowance would be exceeded.
    Capacity,
    /// Setup has ended; existing handles remain usable but definitions are frozen.
    Sealed,
    /// This registry was already attached to an application.
    AlreadyAttached,
    /// Native encoding failed or exceeded the 4 MiB output allowance.
    Encoding,
}
impl std::fmt::Display for MetricError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(match self {
            Self::InvalidDefinition => "invalid metric definition",
            Self::NameConflict => "metric sample name already registered",
            Self::Capacity => "metric registration capacity exceeded",
            Self::Sealed => "metric registration is sealed",
            Self::AlreadyAttached => "metric registry already belongs to an application",
            Self::Encoding => "metric encoding failed or exceeded its output allowance",
        })
    }
}
impl std::error::Error for MetricError {}