referrerpolicy=no-referrer-when-downgrade

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§

source

fn checked_len(&self) -> Option<Idx>

Computes the length of the RangeInclusive, checking for underflow and overflow.

source

fn saturating_len(&self) -> Idx

Computes the length of the RangeInclusive, saturating in case of underflow or overflow.

Implementations on Foreign Types§

source§

impl<Idx> RangeInclusiveExt<Idx> for RangeInclusive<Idx>

source§

fn checked_len(&self) -> Option<Idx>

source§

fn saturating_len(&self) -> Idx

Implementors§