[][src]Struct ndhistogram::axis::CategoryNoFlow

pub struct CategoryNoFlow<T> where
    T: Value, 
{ /* fields omitted */ }

An axis to represent a finite set of discrete values or categories without an overflow bin.

Similar to Category, however, no overflow bin is included.

Example

use ndhistogram::axis::{Axis, CategoryNoFlow, SingleValueBinInterval};
let colors = CategoryNoFlow::new(vec!["red", "blue", "pink", "yellow", "black"]);
assert_eq!(colors.index(&"red"), Some(0));
assert_eq!(colors.index(&"green"), None);
assert_eq!(colors.bin(1), Some(SingleValueBinInterval::new("blue")));
assert_eq!(colors.bin(5), None);

Implementations

impl<T: Value> CategoryNoFlow<T>[src]

pub fn new<I: IntoIterator<Item = T>>(values: I) -> Self[src]

Factory method to create a category axis without an overflow bin.

Takes a set of values that represent each category. All other values will not be included in this axis.

Trait Implementations

impl<T: Value> Axis for CategoryNoFlow<T>[src]

type Coordinate = T

The type representing a location on this axis.

type BinInterval = SingleValueBinInterval<T>

The type of an interval representing the set of Coordinates that correspond to a histogram bin

impl<T: Clone> Clone for CategoryNoFlow<T> where
    T: Value, 
[src]

impl<T: Debug> Debug for CategoryNoFlow<T> where
    T: Value, 
[src]

impl<T: Display + Value> Display for CategoryNoFlow<T>[src]

impl<'a, T: Value> IntoIterator for &'a CategoryNoFlow<T>[src]

type Item = (usize, <Category<T> as Axis>::BinInterval)

The type of the elements being iterated over.

type IntoIter = Box<dyn Iterator<Item = Self::Item> + 'a>

Which kind of iterator are we turning this into?

impl<T: PartialEq> PartialEq<CategoryNoFlow<T>> for CategoryNoFlow<T> where
    T: Value, 
[src]

impl<T> StructuralPartialEq for CategoryNoFlow<T> where
    T: Value, 
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for CategoryNoFlow<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for CategoryNoFlow<T> where
    T: Send
[src]

impl<T> Sync for CategoryNoFlow<T> where
    T: Sync
[src]

impl<T> Unpin for CategoryNoFlow<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for CategoryNoFlow<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.