[][src]Struct susy_pwasm_utils::RefList

pub struct RefList<T> { /* fields omitted */ }

List that tracks references and indices.

Methods

impl<T> RefList<T>[src]

pub fn new() -> Self[src]

New empty list.

pub fn push(&mut self, t: T) -> EntryRef<T>[src]

Push new element in the list.

Returns refernce tracking entry.

pub fn begin_delete(&mut self) -> DeleteTransaction<T>[src]

Start deleting.

Start deleting some entries in the list. Returns transaction that can be populated with number of removed entries. When transaction is finailized, all entries are deleted and internal indices of other entries are updated.

pub fn begin_insert(&mut self, at: usize) -> InsertTransaction<T>[src]

Start inserting.

Start inserting some entries in the list at he designated position. Returns transaction that can be populated with some entries. When transaction is finailized, all entries are inserted and internal indices of other entries might be updated.

pub fn begin_insert_after<F>(&mut self, f: F) -> InsertTransaction<T> where
    F: FnMut(&T) -> bool
[src]

Start inserting after the condition first matches (or at the end).

Start inserting some entries in the list at he designated position. Returns transaction that can be populated with some entries. When transaction is finailized, all entries are inserted and internal indices of other entries might be updated.

pub fn begin_insert_not_until<F>(&mut self, f: F) -> InsertTransaction<T> where
    F: FnMut(&T) -> bool
[src]

Start inserting after the condition first no longer true (or at the end).

Start inserting some entries in the list at he designated position. Returns transaction that can be populated with some entries. When transaction is finailized, all entries are inserted and internal indices of other entries might be updated.

pub fn get(&self, idx: usize) -> Option<EntryRef<T>>[src]

Get entry with index (checked).

Can return None when index out of bounts.

pub fn delete(&mut self, indices: &[usize])[src]

Delete several items.

pub fn delete_one(&mut self, index: usize)[src]

Delete one item.

pub fn from_slice(list: &[T]) -> Self where
    T: Clone
[src]

Initialize from slice.

Slice members are cloned.

pub fn len(&self) -> usize[src]

Length of the list.

pub fn clone_ref(&self, idx: usize) -> EntryRef<T>[src]

Clone entry (reference counting object to item) by index.

Will panic if index out of bounds.

pub fn get_ref(&self, idx: usize) -> &EntryRef<T>[src]

Get reference to entry by index.

Will panic if index out of bounds.

pub fn iter(&self) -> Iter<EntryRef<T>>[src]

Iterate through entries.

Trait Implementations

impl<T> Default for RefList<T>[src]

impl<T: Debug> Debug for RefList<T>[src]

Auto Trait Implementations

impl<T> !Send for RefList<T>

impl<T> !Sync for RefList<T>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.