[][src]Crate nummap

Defines the NumMap struct which acts as if all unmapped keys have a value of 0.

Examples

use nummap::*;
use std::num::NonZeroUsize;
 
let mut map = NumMap::new();
 
//We have set no mapping but we still get 0.
assert_eq!(map.get(&0,), 0,);
 
//We didn't set a mapping here either but we still get 0.
assert_eq!(map.set(0, 10,), 0,);
assert_eq!(map.get(&0,), 10,);

Author --- daniel.bechaz@gmail.com
Last Moddified --- 2019-05-16

Structs

IntoIter

The IntoIterator type which visits all non zero values from a NumMap.

Iter

The Iterator which visits all non zero values in a NumMap.

NumMap

A map of numbers where all keys are considered mapped but 0 values are not stored.

Traits

NonZero

A marker trait for types which are NonZero numbers.

Number

A marker trait for types which have a NonZero equivilant.