Struct sid::MutIdSlice

source ·
pub struct MutIdSlice<'l, ID: Identifier, T: 'l> { /* private fields */ }

Implementations§

source§

impl<'l, ID: Identifier, T: 'l> MutIdSlice<'l, ID, T>

source

pub fn new(slice: &'l mut [T]) -> MutIdSlice<'l, ID, T>

source

pub fn len(&self) -> ID::Handle

source

pub fn untyped(&mut self) -> &mut [T]

source

pub fn iter<'a>(&'a self) -> Iter<'a, T>

source

pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, T>

source

pub fn ids(&self) -> IdRange<ID::Tag, ID::Handle>

source

pub fn nth(&mut self, idx: ID::Handle) -> &mut T

source

pub fn first(&mut self) -> Option<&mut T>

source

pub fn last(&mut self) -> Option<&mut T>

source

pub fn range( &mut self, ids: IdRange<ID::Tag, ID::Handle> ) -> MutIdSlice<'_, ID, T>

source

pub fn range_from(&mut self, id: ID) -> MutIdSlice<'_, ID, T>

source

pub fn range_to(&mut self, id: ID) -> MutIdSlice<'_, ID, T>

source

pub fn range_to_inclusive(&mut self, id: ID) -> MutIdSlice<'_, ID, T>

Trait Implementations§

source§

impl<'l, ID: Identifier, T: 'l> Index<ID> for MutIdSlice<'l, ID, T>

§

type Output = T

The returned type after indexing.
source§

fn index<'a>(&'a self, id: ID) -> &'a T

Performs the indexing (container[index]) operation. Read more
source§

impl<'l, ID: Identifier, T: 'l> IndexMut<ID> for MutIdSlice<'l, ID, T>

source§

fn index_mut<'a>(&'a mut self, id: ID) -> &'a mut T

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'l, ID: Identifier, T: 'l> IntoIterator for MutIdSlice<'l, ID, T>

§

type Item = &'l mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'l, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> IterMut<'l, T>

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'l, ID, T> RefUnwindSafe for MutIdSlice<'l, ID, T>

§

impl<'l, ID, T> Send for MutIdSlice<'l, ID, T>
where ID: Send, T: Send,

§

impl<'l, ID, T> Sync for MutIdSlice<'l, ID, T>
where ID: Sync, T: Sync,

§

impl<'l, ID, T> Unpin for MutIdSlice<'l, ID, T>
where ID: Unpin,

§

impl<'l, ID, T> !UnwindSafe for MutIdSlice<'l, ID, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.