Newtype offering some utility methods for zero-based indices
In order to keep the lengths of method names reasonable, several abbreviations have been used, namely * len for length; * intvl for interval; * int for integer.
``` use zerobasedindex::ZeroBasedIndex;
let zbi = ZeroBasedIndex::
zero_based_index::AsZeroBasedIndex
``` use zerobasedindex::{ZeroBasedIndex, AsZeroBasedIndex};
let zbi = 2.aszerobasedindex(); asserteq!(zbi.trygetlenofclosedintintvlfrom0(), Some(3)); ```
``` use zerobasedindex::ZeroBasedIndex;
let zbi = ZeroBasedIndex::
With unchecked_math
feature, one can also get access to unsafe superpowers.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.