pub struct Range<T: Ord> { /* private fields */ }
Expand description
A range between point A and B, start
and end
are both std Bound
objects
Implementations§
Source§impl<T: Ord> Range<T>
impl<T: Ord> Range<T>
Sourcepub fn new(from: Bound<T>, to: Bound<T>) -> Range<T>
pub fn new(from: Bound<T>, to: Bound<T>) -> Range<T>
Create a new range from the 2 given bounds
Sourcepub fn start(&self) -> Bound<&T>
pub fn start(&self) -> Bound<&T>
Return the starting boundary of the range, with the child object as reference
Sourcepub fn start_pos(&self) -> PositionalBound<&T>
pub fn start_pos(&self) -> PositionalBound<&T>
Return the starting boundary or the range but as PositionalBound
Sourcepub fn end(&self) -> Bound<&T>
pub fn end(&self) -> Bound<&T>
Return the ending boundary of the range, with the child object as reference
Sourcepub fn end_pos(&self) -> PositionalBound<&T>
pub fn end_pos(&self) -> PositionalBound<&T>
Return the ending boundary or the range but as PositionalBound
Sourcepub fn is_unbound(&self) -> bool
pub fn is_unbound(&self) -> bool
Returns true
if this boundary is unbounded, or infinite
Sourcepub fn into_inner(self) -> (Bound<T>, Bound<T>)
pub fn into_inner(self) -> (Bound<T>, Bound<T>)
Returns the internal start
and end
boundaries
Source§impl<T: Ord + Clone> Range<T>
impl<T: Ord + Clone> Range<T>
Sourcepub fn from_range<R: RangeBounds<T>>(value: R) -> Self
pub fn from_range<R: RangeBounds<T>>(value: R) -> Self
Create a new Range
from the
Trait Implementations§
Source§impl<T: Ord + Debug> From<RangeInclusive<T>> for Range<T>
impl<T: Ord + Debug> From<RangeInclusive<T>> for Range<T>
Source§fn from(range: RangeInclusive<T>) -> Self
fn from(range: RangeInclusive<T>) -> Self
Converts to this type from the input type.
Source§impl<T: Ord + Debug> From<RangeToInclusive<T>> for Range<T>
impl<T: Ord + Debug> From<RangeToInclusive<T>> for Range<T>
Source§fn from(range: RangeToInclusive<T>) -> Self
fn from(range: RangeToInclusive<T>) -> Self
Converts to this type from the input type.
impl<T: Eq + Ord> Eq for Range<T>
impl<T: Ord> StructuralPartialEq for Range<T>
Auto Trait Implementations§
impl<T> Freeze for Range<T>where
T: Freeze,
impl<T> RefUnwindSafe for Range<T>where
T: RefUnwindSafe,
impl<T> Send for Range<T>where
T: Send,
impl<T> Sync for Range<T>where
T: Sync,
impl<T> Unpin for Range<T>where
T: Unpin,
impl<T> UnwindSafe for Range<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more