Struct sid::IdSlice

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

Implementations§

source§

impl<'l, T, ID: Identifier> IdSlice<'l, ID, T>
where T: 'l,

source

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

source

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

source

pub fn untyped<'a>(&'a self) -> &'a [T]

source

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

source

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

source

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

source

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

source

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

source

pub fn first_id(&self) -> Option<ID>

source

pub fn last_id(&self) -> Option<ID>

source

pub fn split_at(&self, id: ID) -> (Self, Self)

source

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

source

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

source

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

source

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

Trait Implementations§

source§

impl<'l, T, ID: Identifier> Clone for IdSlice<'l, ID, T>
where T: 'l,

source§

fn clone(&self) -> IdSlice<'l, ID, T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

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

§

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> IntoIterator for IdSlice<'l, ID, T>

§

type Item = &'l T

The type of the elements being iterated over.
§

type IntoIter = Iter<'l, T>

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

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

Creates an iterator from a value. Read more
source§

impl<'l, T, ID: Identifier> Copy for IdSlice<'l, ID, T>
where T: 'l,

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'l, ID, T> UnwindSafe for IdSlice<'l, ID, T>
where ID: UnwindSafe, T: RefUnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.