pub struct Range<T> {
pub start: T,
pub end: RangeEnd<T>,
}Expand description
One-dimensional grouping over a type of value.
Fields§
§start: TA range includes all values greater than or equal to its start value and less than its end_value
end: RangeEnd<T>A range includes all values strictly less than its end value (if it is not open) and greater than or equal to its start value.
Implementations§
Source§impl<T> Range<T>
impl<T> Range<T>
Sourcepub fn new_open(start: T) -> Self
pub fn new_open(start: T) -> Self
Returns a new open range from a start value.
Source§impl<T> Range<T>where
T: PartialOrd,
impl<T> Range<T>where
T: PartialOrd,
Source§impl<T> Range<T>
impl<T> Range<T>
Sourcepub fn intersection(&self, other: &Self) -> Option<Self>
pub fn intersection(&self, other: &Self) -> Option<Self>
Creates the intersection between this Range and another Range, if any.
Trait Implementations§
Source§impl<'a, T> Arbitrary<'a> for Range<T>where
T: Arbitrary<'a> + PartialOrd,
impl<'a, T> Arbitrary<'a> for Range<T>where
T: Arbitrary<'a> + PartialOrd,
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<T: Ord> Ord for Range<T>
impl<T: Ord> Ord for Range<T>
Source§impl<T: PartialOrd> PartialOrd for Range<T>
impl<T: PartialOrd> PartialOrd for Range<T>
impl<T: Copy> Copy for Range<T>
impl<T: Eq> Eq for Range<T>
impl<T> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more