Enum Bound
enum Bound<T>
An endpoint of a range of keys.
Examples
Bounds are range endpoints:
use *;
use RangeBounds;
assert_eq!;
assert_eq!;
assert_eq!;
Using a tuple of Bounds as an argument to BTreeMap::range.
Note that in most cases, it's better to use range syntax (1..5) instead.
use BTreeMap;
use ;
let mut map = new;
map.insert;
map.insert;
map.insert;
for in map.range
assert_eq!;
Variants
-
Included(T) An inclusive bound.
-
Excluded(T) An exclusive bound.
-
Unbounded An infinite endpoint. Indicates that there is no bound in this direction.
Implementations
impl<T> Bound<T>
const fn as_ref(self: &Self) -> Bound<&T>Converts from
&Bound<T>toBound<&T>.const fn as_mut(self: &mut Self) -> Bound<&mut T>Converts from
&mut Bound<T>toBound<&mut T>.fn map<U, F: FnOnce(T) -> U>(self: Self, f: F) -> Bound<U>Maps a
Bound<T>to aBound<U>by applying a function to the contained value (including bothIncludedandExcluded), returning aBoundof the same kind.Examples
use *; let bound_string = Included; assert_eq!;use Bound; use *; let unbounded_string: = Unbounded; assert_eq!;
impl<T: Clone> Bound<&T>
const fn cloned(self: Self) -> Bound<T> where T: ~const CloneMap a
Bound<&T>to aBound<T>by cloning the contents of the bound.Examples
use *; use RangeBounds; let a1 = Stringfrom; let = ; assert_eq!; assert_eq!;
impl<T: Copy> Bound<&T>
const fn copied(self: Self) -> Bound<T>Map a
Bound<&T>to aBound<T>by copying the contents of the bound.Examples
use *; use RangeBounds; assert_eq!; assert_eq!;
impl<T> Any for Bound<T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Bound<T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Bound<T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Bound<T>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> Freeze for Bound<T>
impl<T> From for Bound<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> RefUnwindSafe for Bound<T>
impl<T> Send for Bound<T>
impl<T> StructuralPartialEq for Bound<T>
impl<T> Sync for Bound<T>
impl<T> Unpin for Bound<T>
impl<T> UnsafeUnpin for Bound<T>
impl<T> UnwindSafe for Bound<T>
impl<T, U> Into for Bound<T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Bound<T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Bound<T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::fmt::Debug> Debug for Bound<T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T: $crate::hash::Hash> Hash for Bound<T>
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl<T: $crate::marker::Copy> Copy for Bound<T>
impl<T: ~const $crate::clone::Clone> Clone for Bound<T>
fn clone(self: &Self) -> Bound<T>
impl<T: ~const $crate::cmp::Eq> Eq for Bound<T>
impl<T: ~const $crate::cmp::PartialEq> PartialEq for Bound<T>
fn eq(self: &Self, other: &Bound<T>) -> bool