Struct rpds::vector::Vector [−][src]
pub struct Vector<T, P = RcK> where
P: SharedPointerKind, { /* fields omitted */ }
Expand description
A persistent vector with structural sharing.
Complexity
Let n be the number of elements in the vector.
Temporal complexity
Operation | Average | Worst case |
---|---|---|
new() | Θ(1) | Θ(1) |
set() | Θ(log(n)) | Θ(log(n)) |
push_back() | Θ(log(n)) | Θ(log(n)) |
drop_last() | Θ(log(n)) | Θ(log(n)) |
first() /last() /get() | Θ(log(n)) | Θ(log(n)) |
len() | Θ(1) | Θ(1) |
clone() | Θ(1) | Θ(1) |
iterator creation | Θ(1) | Θ(1) |
iterator step | Θ(1) | Θ(log(n)) |
iterator full | Θ(n) | Θ(n) |
Implementation details
This implementation uses a bitmapped vector trie as described in Understanding Persistent Vector Part 1 and Understanding Persistent Vector Part 2.
Implementations
Returns true
if the operation was successful.
Trait Implementations
impl<'de, T, P> Deserialize<'de> for Vector<T, P> where
T: Deserialize<'de>,
P: SharedPointerKind,
impl<'de, T, P> Deserialize<'de> for Vector<T, P> where
T: Deserialize<'de>,
P: SharedPointerKind,
Deserialize this value from the given Serde deserializer. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
impl<T: PartialEq<U>, U, P, PO> PartialEq<Vector<U, PO>> for Vector<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
impl<T: PartialEq<U>, U, P, PO> PartialEq<Vector<U, PO>> for Vector<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
impl<T: PartialOrd<U>, U, P, PO> PartialOrd<Vector<U, PO>> for Vector<T, P> where
P: SharedPointerKind,
PO: SharedPointerKind,
impl<T: PartialOrd<U>, U, P, PO> PartialOrd<Vector<U, PO>> for Vector<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 Vector<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> UnwindSafe for Vector<T, P> where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more