| 1 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#; |
| 2 | |
| 3 | /// A bucket represents a quantized range of values and a count of observations |
| 4 | /// that fall into that range. |
| 5 | #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq:, Eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/Eq:)] |
| 6 | pub struct Bucketrust-analyzer cargo histogram 1.5.0 bucket/Bucket# { |
| 7 | pub(craterust-analyzer cargo histogram 1.5.0 crate/) countrust-analyzer cargo histogram 1.5.0 bucket/Bucket#count.: u64, |
| 8 | pub(craterust-analyzer cargo histogram 1.5.0 crate/) rangerust-analyzer cargo histogram 1.5.0 bucket/Bucket#range.: RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#<u64>, |
| 9 | } |
| 10 | |
| 11 | impl Bucketrust-analyzer cargo histogram 1.5.0 bucket/Bucket# { |
| 12 | /// Returns the number of observations within the bucket's range. |
| 13 | pub fn countrust-analyzer cargo histogram 1.5.0 bucket/impl#[Bucket]count().(&self) -> u64 { |
| 14 | self.countrust-analyzer cargo histogram 1.5.0 bucket/Bucket#count. |
| 15 | } |
| 16 | |
| 17 | /// Returns the range for the bucket. |
| 18 | pub fn rangerust-analyzer cargo histogram 1.5.0 bucket/impl#[Bucket]range().(&self) -> RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#<u64> { |
| 19 | self.rangerust-analyzer cargo histogram 1.5.0 bucket/Bucket#range..clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`][Clone]clone().() |
| 20 | } |
| 21 | |
| 22 | /// Returns the inclusive lower bound for the bucket. |
| 23 | pub fn startrust-analyzer cargo histogram 1.5.0 bucket/impl#[Bucket]start().(&self) -> u64 { |
| 24 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self.rangerust-analyzer cargo histogram 1.5.0 bucket/Bucket#range..startrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]start().() |
| 25 | } |
| 26 | |
| 27 | /// Returns the inclusive upper bound for the bucket. |
| 28 | pub fn endrust-analyzer cargo histogram 1.5.0 bucket/impl#[Bucket]end().(&self) -> u64 { |
| 29 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&T`][Deref]deref().self.rangerust-analyzer cargo histogram 1.5.0 bucket/Bucket#range..endrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/impl#[`RangeInclusive<Idx>`]end().() |
| 30 | } |
| 31 | } |