[][src]Struct intspan::Coverage

pub struct Coverage { /* fields omitted */ }

Implementations

impl Coverage[src]

pub fn max(&self) -> &i32[src]

pub fn tiers(&self) -> &BTreeMap<i32, IntSpan>[src]

pub fn new(max: i32) -> Self[src]

pub fn new_len(max: i32, len: i32) -> Self[src]

pub fn bump(&mut self, begin: i32, end: i32)[src]

let mut cover = Coverage::new(1);
cover.bump(1, 100);
cover.bump(90, 150);
assert_eq!(cover.tiers().get(&1).unwrap().to_string(), "1-150");

let mut cover = Coverage::new_len(1, 500);
cover.bump(1, 100);
cover.bump(90, 150);
assert_eq!(cover.tiers().get(&1).unwrap().to_string(), "1-150");

pub fn max_tier(&self) -> IntSpan[src]

let mut cover = Coverage::new(2);
cover.bump(1, 100);
cover.bump(90, 150);
assert_eq!(cover.max_tier().to_string(), "90-100");

let mut cover = Coverage::new(5);
cover.bump(1, 100);
cover.bump(90, 150);
assert_eq!(cover.max_tier().to_string(), "-");

pub fn uniq_tiers(&self) -> BTreeMap<i32, IntSpan>[src]

let mut cover = Coverage::new(2);
cover.bump(1, 100);
cover.bump(90, 150);

assert_eq!(cover.uniq_tiers().get(&2).unwrap().to_string(), "90-100");

assert_eq!(cover.tiers().get(&1).unwrap().to_string(), "1-150");
assert_eq!(cover.uniq_tiers().get(&1).unwrap().to_string(), "1-89,101-150");

Trait Implementations

impl Clone for Coverage[src]

impl Default for Coverage[src]

Auto Trait Implementations

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, 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.