RangeExt

Trait RangeExt 

Source
pub trait RangeExt<T>
where Self: Sized,
{ // Required method fn from_range_bounds<B>(bounds: B, min_incl: T, max_excl: T) -> Option<Self> where B: RangeBounds<T>; }
Expand description

An extension trait for ranges

Required Methods§

Source

fn from_range_bounds<B>(bounds: B, min_incl: T, max_excl: T) -> Option<Self>
where B: RangeBounds<T>,

Creates Self from the given range bounds and validates that it is within min_incl and max_excl

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RangeExt<u64> for Range<u64>

Source§

fn from_range_bounds<B>(bounds: B, min_incl: u64, max_excl: u64) -> Option<Self>
where B: RangeBounds<u64>,

Source§

impl RangeExt<u64> for RangeInclusive<u64>

Source§

fn from_range_bounds<B>(bounds: B, min_incl: u64, max_excl: u64) -> Option<Self>
where B: RangeBounds<u64>,

Source§

impl RangeExt<usize> for Range<usize>

Source§

fn from_range_bounds<B>( bounds: B, min_incl: usize, max_excl: usize, ) -> Option<Self>
where B: RangeBounds<usize>,

Source§

impl RangeExt<usize> for RangeInclusive<usize>

Source§

fn from_range_bounds<B>( bounds: B, min_incl: usize, max_excl: usize, ) -> Option<Self>
where B: RangeBounds<usize>,

Implementors§