Trait bp_runtime::RangeInclusiveExt
source · pub trait RangeInclusiveExt<Idx> {
// Required methods
fn checked_len(&self) -> Option<Idx>;
fn saturating_len(&self) -> Idx;
}
Expand description
A trait defining helper methods for RangeInclusive
(start..=end)
Required Methods§
sourcefn checked_len(&self) -> Option<Idx>
fn checked_len(&self) -> Option<Idx>
Computes the length of the RangeInclusive
, checking for underflow and overflow.
sourcefn saturating_len(&self) -> Idx
fn saturating_len(&self) -> Idx
Computes the length of the RangeInclusive
, saturating in case of underflow or overflow.