[−][src]Struct intspan::Coverage
Methods
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
Auto Trait Implementations
impl RefUnwindSafe for Coverage
impl Send for Coverage
impl Sync for Coverage
impl Unpin for Coverage
impl UnwindSafe for Coverage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,