[][src]Trait pui_vec::PuiVecAccess

pub trait PuiVecAccess<T, I>: PuiVecIndex<I> {
    type Output: ?Sized;
    pub unsafe fn get_unchecked<'a>(
        &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; pub fn get<'a>(&self, vec: &'a PuiVec<T, I>) -> Option<&'a Self::Output> { ... }
pub fn get_mut<'a>(
        &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 { ... }
pub fn index_mut<'a>(
        &self,
        vec: &'a mut PuiVec<T, I>
    ) -> &'a mut Self::Output { ... } }

A type that can be used to access a PuiVec

Associated Types

type Output: ?Sized[src]

The output type returned by methods.

Loading content...

Required methods

pub unsafe fn get_unchecked<'a>(
    &self,
    vec: &'a PuiVec<T, I>
) -> &'a Self::Output
[src]

Returns a shared reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-boundsindex or a dangling slice pointer is undefined behavior even if the resulting reference is not used.

Safety

self.contained_in(vec) must return true

pub unsafe fn get_unchecked_mut<'a>(
    &self,
    vec: &'a mut PuiVec<T, I>
) -> &'a mut Self::Output
[src]

Returns a uniquue reference to the output at this location, without performing any bounds checking. Calling this method with an out-of-boundsindex or a dangling slice pointer is undefined behavior even if the resulting reference is not used.

Safety

self.contained_in(vec) must return true

Loading content...

Provided methods

pub fn get<'a>(&self, vec: &'a PuiVec<T, I>) -> Option<&'a Self::Output>[src]

Returns a shared reference to the output at this location, if in bounds.

pub fn get_mut<'a>(
    &self,
    vec: &'a mut PuiVec<T, I>
) -> Option<&'a mut Self::Output>
[src]

Returns a unique reference to the output at this location, if in bounds.

pub fn index<'a>(&self, vec: &'a PuiVec<T, I>) -> &'a Self::Output[src]

Returns a shared reference to the output at this location, panicking if out of bounds.

pub fn index_mut<'a>(&self, vec: &'a mut PuiVec<T, I>) -> &'a mut Self::Output[src]

Returns a unique reference to the output at this location, panicking if out of bounds.

Loading content...

Implementations on Foreign Types

impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for RangeTo<Id<I::Token>>[src]

type Output = [T]

impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for RangeFrom<Id<I::Token>>[src]

type Output = [T]

impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for RangeToInclusive<Id<I::Token>>[src]

type Output = [T]

impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for Range<Id<I::Token>>[src]

type Output = [T]

impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for RangeInclusive<Id<I::Token>>[src]

type Output = [T]

impl<T, I> PuiVecAccess<T, I> for RangeFull[src]

type Output = [T]

impl<T, I> PuiVecAccess<T, I> for RangeTo<usize>[src]

type Output = [T]

impl<T, I> PuiVecAccess<T, I> for RangeFrom<usize>[src]

type Output = [T]

impl<T, I> PuiVecAccess<T, I> for RangeToInclusive<usize>[src]

type Output = [T]

impl<T, I> PuiVecAccess<T, I> for Range<usize>[src]

type Output = [T]

impl<T, I> PuiVecAccess<T, I> for RangeInclusive<usize>[src]

type Output = [T]

Loading content...

Implementors

impl<Pi: ?Sized + PuiVecAccess<T, I>, I, T> PuiVecAccess<T, I> for &Pi[src]

type Output = Pi::Output

impl<Pi: ?Sized + PuiVecAccess<T, I>, I, T> PuiVecAccess<T, I> for &mut Pi[src]

type Output = Pi::Output

impl<T, I> PuiVecAccess<T, I> for usize[src]

type Output = T

impl<T, I: OneShotIdentifier> PuiVecAccess<T, I> for Id<I::Token>[src]

type Output = T

Loading content...