Struct rpds::list::List [−][src]
pub struct List<T, P = RcK> where
P: SharedPointerKind, { /* fields omitted */ }
Expand description
A persistent list with structural sharing.
Complexity
Let n be the number of elements in the list.
Temporal complexity
Operation | Average | Worst case |
---|---|---|
new() | Θ(1) | Θ(1) |
push_front() | Θ(1) | Θ(1) |
drop_first() | Θ(1) | Θ(1) |
reverse() | Θ(n) | Θ(n) |
first() | Θ(1) | Θ(1) |
last() | Θ(1) | Θ(1) |
len() | Θ(1) | Θ(1) |
clone() | Θ(1) | Θ(1) |
iterator creation | Θ(1) | Θ(1) |
iterator step | Θ(1) | Θ(1) |
iterator full | Θ(n) | Θ(n) |
Implementation details
This is your classic functional list with “cons” and “nil” nodes, with a little extra sauce to make some operations more efficient.
Implementations
Trait Implementations
impl<'de, T, P> Deserialize<'de> for List<T, P> where
T: Deserialize<'de>,
P: SharedPointerKind,
impl<'de, T, P> Deserialize<'de> for List<T, P> where
T: Deserialize<'de>,
P: SharedPointerKind,
Deserialize this value from the given Serde deserializer. Read more
Creates a value from an iterator. Read more
impl<T: PartialEq, P, PO> PartialEq<List<T, PO>> for List<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
impl<T: PartialEq, P, PO> PartialEq<List<T, PO>> for List<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
impl<T: PartialOrd<T>, P, PO> PartialOrd<List<T, PO>> for List<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
impl<T: PartialOrd<T>, P, PO> PartialOrd<List<T, PO>> for List<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<T, P> RefUnwindSafe for List<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> UnwindSafe for List<T, P> where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more