referrerpolicy=no-referrer-when-downgrade
bp_runtime

Trait 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§