Enum any_range::AnyRange [−][src]
An enum that can hold any Range* type.
Example
use any_range::AnyRange; let range: AnyRange<u8> = (3..5).into(); assert!(range.contains(&3));
Variants
Range(Range<T>)
RangeFrom(RangeFrom<T>)
RangeFull(RangeFull)
RangeInclusive(RangeInclusive<T>)
RangeTo(RangeTo<T>)
RangeToInclusive(RangeToInclusive<T>)
Implementations
impl<T: Clone + PartialOrd + PartialEq> AnyRange<T>
[src]
pub fn contains(&self, value: &T) -> bool
[src]
Returns true if item is contained in the range.
pub fn start_bound(&self) -> Bound<&T>
[src]
Returns the start value as a Bound.
pub fn end_bound(&self) -> Bound<&T>
[src]
Returns the end value as a Bound.
Trait Implementations
impl<T: Clone + PartialOrd + PartialEq> Clone for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq + Debug> Debug for AnyRange<T>
[src]
impl<T: Eq + Clone + PartialOrd + PartialEq> Eq for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> From<Range<T>> for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> From<RangeFrom<T>> for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> From<RangeFull> for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> From<RangeInclusive<T>> for AnyRange<T>
[src]
fn from(r: RangeInclusive<T>) -> Self
[src]
impl<T: Clone + PartialOrd + PartialEq> From<RangeTo<T>> for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> From<RangeToInclusive<T>> for AnyRange<T>
[src]
fn from(r: RangeToInclusive<T>) -> Self
[src]
impl<T: PartialEq + Clone + PartialOrd> PartialEq<AnyRange<T>> for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> RangeBounds<T> for AnyRange<T>
[src]
fn start_bound(&self) -> Bound<&T>
[src]
fn end_bound(&self) -> Bound<&T>
[src]
pub fn contains<U>(&self, item: &U) -> bool where
T: PartialOrd<U>,
U: PartialOrd<T> + ?Sized,
1.35.0[src]
T: PartialOrd<U>,
U: PartialOrd<T> + ?Sized,
impl<T: Clone + PartialOrd + PartialEq> StructuralEq for AnyRange<T>
[src]
impl<T: Clone + PartialOrd + PartialEq> StructuralPartialEq for AnyRange<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for AnyRange<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for AnyRange<T> where
T: Send,
T: Send,
impl<T> Sync for AnyRange<T> where
T: Sync,
T: Sync,
impl<T> Unpin for AnyRange<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for AnyRange<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,