[−][src]Trait typed_index_collections::TiSliceIndex
A helper trait used for indexing operations.
This trait is implemented for K
, Range<K>
, RangeTo<K>
, RangeFrom<K>
,
RangeInclusive<K>
and RangeToInclusive<K>
.
The RangeFull<K>
trait is not currently supported.
Trait implementations are only forwards to standard Rust slice
operations.
Associated Types
Loading content...Required methods
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
Returns a shared reference to the output at this location, if in bounds.
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
Returns a mutable reference to the output at this location, if in bounds.
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
Returns a mutable reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.
fn index(self, slice: &TiSlice<K, V>) -> &Self::Output
Returns a shared reference to the output at this location, panicking if out of bounds.
fn index_mut(self, slice: &mut TiSlice<K, V>) -> &mut Self::Output
Returns a mutable reference to the output at this location, panicking if out of bounds.
Implementations on Foreign Types
impl<K, V> TiSliceIndex<K, V> for Range<K> where
usize: From<K>,
[src]
usize: From<K>,
type Output = TiSlice<K, V>
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
[src]
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
[src]
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
fn index(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
fn index_mut(self, slice: &mut TiSlice<K, V>) -> &mut Self::Output
[src]
impl<K, V> TiSliceIndex<K, V> for RangeFrom<K> where
usize: From<K>,
[src]
usize: From<K>,
type Output = TiSlice<K, V>
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
[src]
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
[src]
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
fn index(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
fn index_mut(self, slice: &mut TiSlice<K, V>) -> &mut Self::Output
[src]
impl<K, V> TiSliceIndex<K, V> for RangeInclusive<K> where
usize: From<K>,
[src]
usize: From<K>,
type Output = TiSlice<K, V>
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
[src]
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
[src]
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
fn index(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
fn index_mut(self, slice: &mut TiSlice<K, V>) -> &mut Self::Output
[src]
impl<K, V> TiSliceIndex<K, V> for RangeTo<K> where
usize: From<K>,
[src]
usize: From<K>,
type Output = TiSlice<K, V>
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
[src]
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
[src]
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
fn index(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
fn index_mut(self, slice: &mut TiSlice<K, V>) -> &mut Self::Output
[src]
impl<K, V> TiSliceIndex<K, V> for RangeToInclusive<K> where
usize: From<K>,
[src]
usize: From<K>,
type Output = TiSlice<K, V>
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
[src]
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
[src]
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
fn index(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
fn index_mut(self, slice: &mut TiSlice<K, V>) -> &mut Self::Output
[src]
Implementors
impl<K, V> TiSliceIndex<K, V> for K where
usize: From<K>,
[src]
usize: From<K>,
type Output = V
fn get(self, slice: &TiSlice<K, V>) -> Option<&Self::Output>
[src]
fn get_mut(self, slice: &mut TiSlice<K, V>) -> Option<&mut Self::Output>
[src]
unsafe fn get_unchecked(self, slice: &TiSlice<K, V>) -> &Self::Output
[src]
unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output
[src]
self,
slice: &mut TiSlice<K, V>
) -> &mut Self::Output