base2histogram 0.2.3

A Rust histogram library using base-2 logarithmic bucketing for fast percentile estimation
Documentation
use crate::histogram::Histogram;

/// A named histogram series within an [`super::ascii_chart::AsciiChart`].
#[derive(Debug, Clone)]
pub struct Series<T> {
    /// Display name used in chart legends and percentile footer.
    pub(crate) name: String,

    /// The source histogram.
    pub(crate) histogram: Histogram<T>,
}

impl<T> Series<T> {
    /// Creates a named series from a histogram.
    pub fn new(name: impl ToString, histogram: Histogram<T>) -> Self {
        Self {
            name: name.to_string(),
            histogram,
        }
    }
}