[−][src]Struct typed_index_collection::Idx
Typed index.
Trait Implementations
impl<T> Clone for Idx<T>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Copy for Idx<T>
[src]
impl<T: Debug> Debug for Idx<T>
[src]
impl<T> Eq for Idx<T>
[src]
impl<T> Hash for Idx<T>
[src]
pub fn hash<__HT>(&self, __state: &mut __HT) where
__HT: Hasher,
[src]
__HT: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Index<Idx<T>> for Collection<T>
[src]
type Output = T
The returned type after indexing.
pub fn index(&self, index: Idx<T>) -> &Self::Output
[src]
impl<T> IndexMut<Idx<T>> for Collection<T>
[src]
pub fn index_mut(&mut self, idx: Idx<T>) -> &mut T
[src]
Access a mutable reference on an entry of the Collection
from its
Idx
.
use typed_index_collection::Collection; let mut c = Collection::new(vec![-2, -1, 0, 1, 2]); let negatives_idxs = c .iter() .filter(|(_, &v)| v < 0) .map(|(idx, _)| idx) .collect::<Vec<_>>(); for idx in negatives_idxs { *c.index_mut(idx) = 0; } assert_eq!(vec![0, 0, 0, 1, 2], c.take());
impl<T> Ord for Idx<T>
[src]
pub fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T> PartialEq<Idx<T>> for Idx<T>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T> PartialOrd<Idx<T>> for Idx<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Idx<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Idx<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Idx<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Idx<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Idx<T> where
T: UnwindSafe,
[src]
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>,