[−][src]Trait glsp_engine::DequeAccess
Indexing the deque
abstract type.
When manipulating an Arr
, Str
or
Deque
, you'll mostly use this trait's methods, along with
DequeOps
and DequeAccessRange
.
This trait is sealed. It's not possible to implement this trait for your own types.
Required methods
fn get<R: FromElement<Self::Element>>(&self, index: I) -> GResult<R>
Accesses an element in the deque.
Equivalent to [deq index]
.
fn set<V: IntoElement<Self::Element>>(&self, index: I, val: V) -> GResult<()>
Mutates an element in the deque.
Equivalent to (= [deq index] val)
.
fn insert<V: IntoElement<Self::Element>>(&self, index: I, val: V) -> GResult<()>
Inserts an element into the deque at the given index.
Equivalent to (insert! deq index val)
.
fn del(&self, index: I) -> GResult<()>
Deletes an element from the deque, without returning it.
Equivalent to (del! deq index)
.
fn remove<R: FromElement<Self::Element>>(&self, index: I) -> GResult<R>
Removes an element from the deque and returns it.
Equivalent to (remove! deq index)
.
fn swap_remove<R: FromElement<Self::Element>>(&self, index: I) -> GResult<R>
Swaps an element with the last element, removes it, and returns it.
Equivalent to (swap-remove! deq index)
.
fn swap_remove_start<R: FromElement<Self::Element>>(
&self,
index: I
) -> GResult<R>
&self,
index: I
) -> GResult<R>
Swaps an element with the first element, removes it, and returns it.
Equivalent to (swap-remove-start! deq index)
.