pub enum PersistentList {
Empty,
Cons {
head: Value,
tail: Arc<PersistentList>,
count: usize,
},
}Expand description
An immutable singly-linked list. Structural sharing via Arc-backed tails.
Clojure’s PersistentList is the primary seq type; it supports O(1) cons,
first, and rest. count is cached on each node so it is also O(1).
Variants§
Implementations§
Source§impl PersistentList
impl PersistentList
Trait Implementations§
Source§impl Clone for PersistentList
impl Clone for PersistentList
Source§fn clone(&self) -> PersistentList
fn clone(&self) -> PersistentList
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PersistentList
impl Debug for PersistentList
Source§impl FromIterator<Value> for PersistentList
impl FromIterator<Value> for PersistentList
Source§impl PartialEq for PersistentList
impl PartialEq for PersistentList
Source§impl Trace for PersistentList
impl Trace for PersistentList
fn trace(&self, visitor: &mut MarkVisitor)
fn gc_size_extra(&self) -> usize
Auto Trait Implementations§
impl !RefUnwindSafe for PersistentList
impl !Send for PersistentList
impl !Sync for PersistentList
impl !UnwindSafe for PersistentList
impl Freeze for PersistentList
impl Unpin for PersistentList
impl UnsafeUnpin for PersistentList
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more