[−][src]Struct glsp::Arr
The arr
primitive type.
Most of this type's methods belong to the deque
abstract type, so they can be found in the
traits DequeOps
, DequeAccess
, and
DequeAccessRange
.
New arrays can be constructed using the arr!
macro or various toplevel
functions, such as glsp::arr
and glsp::arr_from_iter
.
Arrays are always stored on the garbage-collected heap, so they're normally represented by
the type Root<Arr>
.
Implementations
impl Arr
[src]
pub fn shallow_clone(&self) -> Root<Arr>ⓘ
[src]
Creates a shallow copy of an array.
Equivalent to (clone ar)
.
pub fn deep_clone(&self) -> Result<Root<Arr>, GError>
[src]
Recursively copies an array and all of its contents.
Equivalent to (deep-clone ar)
.
pub fn try_eq(&self, other: &Arr) -> Result<bool, GError>
[src]
Equivalent to (eq? self other)
.
Note that, because this method may need to invoke an op-eq?
method when one of its
elements is an object or an RData
, it can potentially fail.
The same is true for PartialEq
comparisons between arrays using Rust's ==
operator.
In that case, if an error occurs, the operator will panic.
pub fn access_giter(arr: &Root<Arr>, giter: &Root<GIter>) -> Root<GIter>ⓘ
[src]
Creates an indexing iterator for this collection.
Equivalent to [ar iter]
.
impl Arr
[src]
pub fn is_representable(&self) -> bool
[src]
Returns true
if this array can be losslessly converted to text.
pub fn check_representability(&self) -> Result<(), &'static str>
[src]
Returns Ok
if this array can be losslessly converted to text.
pub fn is_serializable(&self) -> bool
[src]
Returns true
if this array can be serialized and deserialized using Serde.
This method is only present when the "serde"
feature is enabled.
pub fn check_serializability(&self) -> Result<(), &'static str>
[src]
Returns Ok
if this array can be serialized and deserialized using Serde.
This method is only present when the "serde"
feature is enabled.
Trait Implementations
impl Debug for Arr
[src]
impl<I> DequeAccess<I> for Arr where
I: DequeIndex,
[src]
I: DequeIndex,
pub fn get<R>(&self, index: I) -> Result<R, GError> where
R: FromElement<Slot>,
[src]
R: FromElement<Slot>,
pub fn set<V>(&self, index: I, val: V) -> Result<(), GError> where
V: IntoElement<Slot>,
[src]
V: IntoElement<Slot>,
pub fn insert<V>(&self, index: I, val: V) -> Result<(), GError> where
V: IntoElement<Slot>,
[src]
V: IntoElement<Slot>,
pub fn del(&self, index: I) -> Result<(), GError>
[src]
pub fn remove<R>(&self, index: I) -> Result<R, GError> where
R: FromElement<Slot>,
[src]
R: FromElement<Slot>,
pub fn swap_remove<R>(&self, index: I) -> Result<R, GError> where
R: FromElement<Slot>,
[src]
R: FromElement<Slot>,
pub fn swap_remove_start<R>(&self, index: I) -> Result<R, GError> where
R: FromElement<Slot>,
[src]
R: FromElement<Slot>,
impl<I, R> DequeAccessRange<I, R> for Arr where
R: DequeRange<I> + Debug,
I: DequeIndex,
[src]
R: DequeRange<I> + Debug,
I: DequeIndex,
impl DequeOps for Arr
[src]
type Element = Slot
type Item = Val
pub fn freeze(&self)
[src]
pub fn deep_freeze(&self)
[src]
pub fn is_frozen(&self) -> bool
[src]
pub fn is_deep_frozen(&self) -> bool
[src]
pub fn can_mutate(&self) -> bool
[src]
pub fn sort(&self) -> Result<(), GError>
[src]
pub fn sort_by<F>(&self, f: F) -> Result<(), GError> where
F: FnMut(&Val, &Val) -> Result<Ordering, GError>,
[src]
F: FnMut(&Val, &Val) -> Result<Ordering, GError>,
pub fn push<V>(&self, val: V) -> Result<(), GError> where
V: IntoElement<Slot>,
[src]
V: IntoElement<Slot>,
pub fn pop<R>(&self) -> Result<R, GError> where
R: FromElement<Slot>,
[src]
R: FromElement<Slot>,
pub fn push_start<V>(&self, val: V) -> Result<(), GError> where
V: IntoElement<Slot>,
[src]
V: IntoElement<Slot>,
pub fn pop_start<R>(&self) -> Result<R, GError> where
R: FromElement<Slot>,
[src]
R: FromElement<Slot>,
pub fn grow<V>(
&self,
start_to_add: usize,
end_to_add: usize,
fill: V
) -> Result<(), GError> where
V: IntoElement<Slot>,
[src]
&self,
start_to_add: usize,
end_to_add: usize,
fill: V
) -> Result<(), GError> where
V: IntoElement<Slot>,
pub fn shrink(
&self,
start_to_remove: usize,
end_to_remove: usize
) -> Result<(), GError>
[src]
&self,
start_to_remove: usize,
end_to_remove: usize
) -> Result<(), GError>
pub fn append(&self, other: &Arr) -> Result<(), GError>
[src]
pub fn prepend(&self, other: &Arr) -> Result<(), GError>
[src]
pub fn resize<V>(&self, new_len: usize, fill: V) -> Result<(), GError> where
V: IntoElement<Slot>,
[src]
V: IntoElement<Slot>,
pub fn rotate_left(&self, mid: usize) -> Result<(), GError>
[src]
pub fn rotate_right(&self, k: usize) -> Result<(), GError>
[src]
pub fn swap<I1, I2>(&self, index1: I1, index2: I2) -> Result<(), GError> where
I1: DequeIndex,
I2: DequeIndex,
[src]
I1: DequeIndex,
I2: DequeIndex,
pub fn capacity(&self) -> usize
[src]
pub fn len(&self) -> usize
[src]
pub fn reserve_exact(&self, additional: usize) -> Result<(), GError>
[src]
pub fn reserve(&self, additional: usize) -> Result<(), GError>
[src]
pub fn shrink_to_fit(&self) -> Result<(), GError>
[src]
pub fn truncate(&self, len: usize) -> Result<(), GError>
[src]
pub fn clear(&self) -> Result<(), GError>
[src]
pub fn contains<V>(&self, x: V) -> Result<bool, GError> where
V: IntoElement<Slot>,
[src]
V: IntoElement<Slot>,
pub fn extend<I, V>(&self, source: I) -> Result<(), GError> where
I: IntoIterator<Item = V>,
V: IntoElement<Slot>,
[src]
I: IntoIterator<Item = V>,
V: IntoElement<Slot>,
pub fn is_empty(&self) -> bool
[src]
pub fn iter(&'a self) -> IterDeque<'a, Self>ⓘ where
Self: DequeAccess<usize>,
[src]
Self: DequeAccess<usize>,
pub fn iter_to<R>(&'a self) -> IterDequeTo<'a, Self, R>ⓘNotable traits for IterDequeTo<'a, T, R>
impl<'a, T, R> Iterator for IterDequeTo<'a, T, R> where
T: DequeAccess<usize>,
R: FromElement<<T as DequeOps>::Element>, type Item = Result<R, GError>;
where
Self: DequeAccess<usize>,
R: FromElement<Self::Element>,
[src]
Notable traits for IterDequeTo<'a, T, R>
impl<'a, T, R> Iterator for IterDequeTo<'a, T, R> where
T: DequeAccess<usize>,
R: FromElement<<T as DequeOps>::Element>, type Item = Result<R, GError>;
Self: DequeAccess<usize>,
R: FromElement<Self::Element>,
impl Display for Arr
[src]
impl Eq for Arr
[src]
impl Hash for Arr
[src]
pub fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> IntoIterator for &'a Arr
[src]
type Item = Val
The type of the elements being iterated over.
type IntoIter = IterDeque<'a, Arr>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> IterDeque<'a, Arr>ⓘ
[src]
impl PartialEq<Arr> for Arr
[src]
pub fn eq(&self, other: &Arr) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Arr> for Arr
[src]
pub fn partial_cmp(&self, other: &Arr) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for Arr
[src]
pub fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl Splay for Arr
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Arr
[src]
impl !Send for Arr
[src]
impl !Sync for Arr
[src]
impl Unpin for Arr
[src]
impl !UnwindSafe for Arr
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoElement<Slot> for T where
T: IntoVal,
[src]
T: IntoVal,
pub fn into_element(self) -> Result<Slot, GError>
[src]
impl<T> IntoVal for T where
T: StaticMarker,
[src]
T: StaticMarker,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,