AnyRange

Trait AnyRange 

Source
pub trait AnyRange<Index> {
    // Required methods
    fn start(&self) -> Option<Index>;
    fn end(&self) -> Option<Index>;

    // Provided method
    fn to_range(&self, start: Index, end: Index) -> Range<Index> { ... }
}

Required Methods§

Source

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

returns Sone(s) if a start has been specified

Source

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

returns Sone(s) if an end has been specified

Provided Methods§

Source

fn to_range(&self, start: Index, end: Index) -> Range<Index>

converts this range into a concrete std::ops::Range<Index> by defaulting non-existant bounds to the given start/end values

Implementations on Foreign Types§

Source§

impl<I> AnyRange<I> for RangeFull

Source§

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

Source§

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

Source§

fn to_range(&self, start: I, end: I) -> Range<I>

Source§

impl<I: Clone> AnyRange<I> for Range<I>

Source§

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

Source§

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

Source§

fn to_range(&self, _: I, _: I) -> Range<I>

Source§

impl<I: Clone> AnyRange<I> for RangeFrom<I>

Source§

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

Source§

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

Source§

impl<I: Clone> AnyRange<I> for RangeTo<I>

Source§

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

Source§

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

Implementors§