Trait foyer_common::range::RangeBoundsExt

source ·
pub trait RangeBoundsExt<T: PartialOrd<T> + Add<Output = T> + Sub<Output = T> + Clone + Copy + Send + Sync + 'static + ZeroOne>: RangeBounds<T> {
    // Provided methods
    fn start(&self) -> Option<T> { ... }
    fn end(&self) -> Option<T> { ... }
    fn start_with_bound(&self, bound: T) -> T { ... }
    fn end_with_bound(&self, bound: T) -> T { ... }
    fn bounds(&self, range: Range<T>) -> Range<T> { ... }
    fn size(&self) -> Option<T> { ... }
    fn is_empty(&self) -> bool { ... }
    fn is_full(&self) -> bool { ... }
    fn map<F, R>(&self, f: F) -> (Bound<R>, Bound<R>)
       where F: Fn(&T) -> R { ... }
}
Expand description

The range extensions.

Provided Methods§

source

fn start(&self) -> Option<T>

Get the start bound of the range.

source

fn end(&self) -> Option<T>

Get the end bound of the range.

source

fn start_with_bound(&self, bound: T) -> T

Get the start bound with a default value of the range.

source

fn end_with_bound(&self, bound: T) -> T

Get the end bound with a default value of the range.

source

fn bounds(&self, range: Range<T>) -> Range<T>

Get the new range with the given range bounds.

source

fn size(&self) -> Option<T>

Get the range size.

source

fn is_empty(&self) -> bool

Check if the range is empty.

source

fn is_full(&self) -> bool

Check is the range is a full range.

source

fn map<F, R>(&self, f: F) -> (Bound<R>, Bound<R>)
where F: Fn(&T) -> R,

Map the range with the given method.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: PartialOrd<T> + Add<Output = T> + Sub<Output = T> + Clone + Copy + Send + Sync + 'static + ZeroOne, RB: RangeBounds<T>> RangeBoundsExt<T> for RB