[−][src]Struct pui_vec::Id
A branded index that can be used to elide bounds checks
Implementations
impl<T> Id<T>
[src]
pub const unsafe fn new_unchecked(index: usize, token: T) -> Self
[src]
Create a new branded index
Safety
The given index must be in bounds for the PuiVec
whose identifier owns
the given token
pub fn into_raw_parts(self) -> (usize, T)
[src]
Get the index and token from the branded index
pub const fn get(&self) -> usize
[src]
Returns the index of this Id
pub const fn token(&self) -> &T
[src]
Returns a reference to the token of this Id
Trait Implementations
impl<I: OneShotIdentifier> BuildPuiVecIndex<I> for Id<I::Token>
[src]
pub unsafe fn new_unchecked(slice_index: Self::SliceIndex, ident: &I) -> Self
[src]
impl<T: Clone> Clone for Id<T>
[src]
pub fn clone(&self) -> Id<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Copy> Copy for Id<T>
[src]
impl<T: Debug> Debug for Id<T>
[src]
impl<T: Eq> Eq for Id<T>
[src]
impl<T: Hash> Hash for Id<T>
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Ord> Ord for Id<T>
[src]
pub fn cmp(&self, other: &Id<T>) -> 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> PartialEq<Id<T>> for Id<T>
[src]
impl<T: PartialOrd> PartialOrd<Id<T>> for Id<T>
[src]
pub fn partial_cmp(&self, other: &Id<T>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Id<T>) -> bool
[src]
pub fn le(&self, other: &Id<T>) -> bool
[src]
pub fn gt(&self, other: &Id<T>) -> bool
[src]
pub fn ge(&self, other: &Id<T>) -> bool
[src]
impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for Id<I::Token>
[src]
type Output = T
The output type returned by methods.
pub unsafe fn get_unchecked<'a>(
&self,
vec: &'a PuiVec<T, I>
) -> &'a Self::Output
[src]
&self,
vec: &'a PuiVec<T, I>
) -> &'a Self::Output
pub unsafe fn get_unchecked_mut<'a>(
&self,
vec: &'a mut PuiVec<T, I>
) -> &'a mut Self::Output
[src]
&self,
vec: &'a mut PuiVec<T, I>
) -> &'a mut Self::Output
pub fn get<'a>(&self, vec: &'a PuiVec<T, I>) -> Option<&'a Self::Output>
[src]
pub fn get_mut<'a>(
&self,
vec: &'a mut PuiVec<T, I>
) -> Option<&'a mut Self::Output>
[src]
&self,
vec: &'a mut PuiVec<T, I>
) -> Option<&'a mut Self::Output>
pub fn index<'a>(&self, vec: &'a PuiVec<T, I>) -> &'a Self::Output
[src]
pub fn index_mut<'a>(&self, vec: &'a mut PuiVec<T, I>) -> &'a mut Self::Output
[src]
impl<I: OneShotIdentifier> PuiVecIndex<I> for Id<I::Token>
[src]
type SliceIndex = usize
The underlying index/range type
pub fn contained_in<T>(&self, vec: &PuiVec<T, I>) -> bool
[src]
pub fn slice_index(&self) -> Self::SliceIndex
[src]
impl<T> StructuralEq for Id<T>
[src]
impl<T> StructuralPartialEq for Id<T>
[src]
Auto Trait Implementations
impl<T> Send for Id<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Id<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Id<T> where
T: Unpin,
[src]
T: Unpin,
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>,