[−][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
pub fn get<R: FromElement<Self::Element>>(&self, index: I) -> GResult<R>
[src]
Accesses an element in the deque.
Equivalent to [deq index]
.
pub fn set<V: IntoElement<Self::Element>>(
&self,
index: I,
val: V
) -> GResult<()>
[src]
&self,
index: I,
val: V
) -> GResult<()>
Mutates an element in the deque.
Equivalent to (= [deq index] val)
.
pub fn insert<V: IntoElement<Self::Element>>(
&self,
index: I,
val: V
) -> GResult<()>
[src]
&self,
index: I,
val: V
) -> GResult<()>
Inserts an element into the deque at the given index.
Equivalent to (insert! deq index val)
.
pub fn del(&self, index: I) -> GResult<()>
[src]
Deletes an element from the deque, without returning it.
Equivalent to (del! deq index)
.
pub fn remove<R: FromElement<Self::Element>>(&self, index: I) -> GResult<R>
[src]
Removes an element from the deque and returns it.
Equivalent to (remove! deq index)
.
pub fn swap_remove<R: FromElement<Self::Element>>(&self, index: I) -> GResult<R>
[src]
Swaps an element with the last element, removes it, and returns it.
Equivalent to (swap-remove! deq index)
.
pub fn swap_remove_start<R: FromElement<Self::Element>>(
&self,
index: I
) -> GResult<R>
[src]
&self,
index: I
) -> GResult<R>
Swaps an element with the first element, removes it, and returns it.
Equivalent to (swap-remove-start! deq index)
.