pub struct ListSlice<'a, V, M = MemoryReclaimOnThreshold<2, V, V::Reclaimer>, P = SplitVec<Node<V>, Recursive>>{ /* private fields */ }
Expand description
A slice of a linked list.
Note that a list slice itself behaves pretty much like a linked list. However, it does not own the data, but provides a view on it, just as a slice of a vec.
Implementations§
Source§impl<V, M> ListSlice<'_, V, M>where
V: ListVariant,
M: MemoryPolicy<V>,
impl<V, M> ListSlice<'_, V, M>where
V: ListVariant,
M: MemoryPolicy<V>,
Trait Implementations§
Source§impl<'i, T, M, P> Index<&'i NodeIdx<Doubly<T>>> for ListSlice<'_, Doubly<T>, M, P>
impl<'i, T, M, P> Index<&'i NodeIdx<Doubly<T>>> for ListSlice<'_, Doubly<T>, M, P>
Source§impl<'i, T, M, P> Index<&'i NodeIdx<Singly<T>>> for ListSlice<'_, Singly<T>, M, P>
impl<'i, T, M, P> Index<&'i NodeIdx<Singly<T>>> for ListSlice<'_, Singly<T>, M, P>
impl<T, M, P> Eq for ListSlice<'_, Doubly<T>, M, P>
impl<T, M, P> Eq for ListSlice<'_, Singly<T>, M, P>
Auto Trait Implementations§
impl<'a, V, M, P> Freeze for ListSlice<'a, V, M, P>
impl<'a, V, M, P> RefUnwindSafe for ListSlice<'a, V, M, P>
impl<'a, V, M, P> Send for ListSlice<'a, V, M, P>
impl<'a, V, M, P> Sync for ListSlice<'a, V, M, P>
impl<'a, V, M, P> Unpin for ListSlice<'a, V, M, P>
impl<'a, V, M, P> UnwindSafe for ListSlice<'a, V, M, P>
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
Source§impl<L, T, M, P> DoublyEnds<T, M, P> for L
impl<L, T, M, P> DoublyEnds<T, M, P> for L
Source§fn front<'a>(&'a self) -> Option<&'a T>where
M: 'a,
P: 'a,
fn front<'a>(&'a self) -> Option<&'a T>where
M: 'a,
P: 'a,
O(1) Returns a reference to the front of the list. Read more
Source§fn back<'a>(&'a self) -> Option<&'a T>where
M: 'a,
P: 'a,
fn back<'a>(&'a self) -> Option<&'a T>where
M: 'a,
P: 'a,
O(1) Returns a reference to the back of the list. Read more
Source§fn idx_err(&self, idx: &DoublyIdx<T>) -> Option<NodeIdxError>
fn idx_err(&self, idx: &DoublyIdx<T>) -> Option<NodeIdxError>
O(1) Returns a None if the given node
idx
is valid. Read moreSource§fn is_valid(&self, idx: &DoublyIdx<T>) -> bool
fn is_valid(&self, idx: &DoublyIdx<T>) -> bool
O(1) Returns whether or not the
idx
is valid for this list; i.e., Read moreSource§fn get<'a>(&'a self, idx: &DoublyIdx<T>) -> Option<&'a T>where
M: 'a,
P: 'a,
fn get<'a>(&'a self, idx: &DoublyIdx<T>) -> Option<&'a T>where
M: 'a,
P: 'a,
O(1) Returns a reference to the node with the given
idx
in constant time. Read moreSource§fn try_get<'a>(&'a self, idx: &DoublyIdx<T>) -> Result<&'a T, NodeIdxError>where
M: 'a,
P: 'a,
fn try_get<'a>(&'a self, idx: &DoublyIdx<T>) -> Result<&'a T, NodeIdxError>where
M: 'a,
P: 'a,
O(1) Returns a reference to the node with the given
idx
in constant time. Read moreSource§fn next_idx_of(&self, idx: &DoublyIdx<T>) -> Option<DoublyIdx<T>>
fn next_idx_of(&self, idx: &DoublyIdx<T>) -> Option<DoublyIdx<T>>
O(1) Returns the index of the element succeeding the one with the given
idx
.
Returns None if the element at idx
is the back
. Read moreSource§fn next_of<'a>(&'a self, idx: &DoublyIdx<T>) -> Option<&'a T>where
M: 'a,
P: 'a,
fn next_of<'a>(&'a self, idx: &DoublyIdx<T>) -> Option<&'a T>where
M: 'a,
P: 'a,
O(1) Returns the element succeeding the one with the given
idx
.
Returns None if the element at idx
is the back
. Read moreSource§impl<L, T, M, P> DoublyIterable<T, M, P> for L
impl<L, T, M, P> DoublyIterable<T, M, P> for L
Source§fn iter_ptr<'a>(&'a self) -> DoublyIterPtr<'a, T, P> ⓘwhere
M: 'a,
fn iter_ptr<'a>(&'a self) -> DoublyIterPtr<'a, T, P> ⓘwhere
M: 'a,
Returns a double-ended iterator of pointers to the elements of the list from front to back.
Source§fn iter<'a>(&'a self) -> DoublyIter<'a, T, P> ⓘwhere
M: 'a,
fn iter<'a>(&'a self) -> DoublyIter<'a, T, P> ⓘwhere
M: 'a,
Returns a double-ended iterator to elements of the list: Read more
Source§fn iter_links<'a>(&'a self) -> DoublyLinkIter<'a, T, P> ⓘwhere
M: 'a,
fn iter_links<'a>(&'a self) -> DoublyLinkIter<'a, T, P> ⓘwhere
M: 'a,
Creates a forward iterator that yields pairs of successive elements representing links. Read more
Source§fn indices<'a>(&'a self) -> impl Iterator<Item = DoublyIdx<T>>where
M: 'a,
T: 'a,
P: 'a,
fn indices<'a>(&'a self) -> impl Iterator<Item = DoublyIdx<T>>where
M: 'a,
T: 'a,
P: 'a,
Returns an iterator of indices of elements of the list. Read more
Source§fn pointers<'a>(&'a self) -> impl Iterator<Item = DoublyPtr<T>>where
M: 'a,
T: 'a,
P: 'a,
fn pointers<'a>(&'a self) -> impl Iterator<Item = DoublyPtr<T>>where
M: 'a,
T: 'a,
P: 'a,
Returns an iterator of pointers to the elements of the list. Read more
Source§fn ring_iter<'a>(
&'a self,
pivot_idx: &DoublyIdx<T>,
) -> Chain<DoublyIter<'a, T, P>, DoublyIter<'a, T, P>>where
M: 'a,
fn ring_iter<'a>(
&'a self,
pivot_idx: &DoublyIdx<T>,
) -> Chain<DoublyIter<'a, T, P>, DoublyIter<'a, T, P>>where
M: 'a,
Creates a forward iterator starting from the
pivot_idx
and ending at the element before it. Read moreSource§fn iter_from<'a>(&'a self, idx: &DoublyIdx<T>) -> DoublyIter<'a, T, P> ⓘwhere
M: 'a,
fn iter_from<'a>(&'a self, idx: &DoublyIdx<T>) -> DoublyIter<'a, T, P> ⓘwhere
M: 'a,
Creates a forward iterator: Read more
Source§fn iter_backward_from<'a>(
&'a self,
idx: &DoublyIdx<T>,
) -> Rev<DoublyIter<'a, T, P>>where
M: 'a,
fn iter_backward_from<'a>(
&'a self,
idx: &DoublyIdx<T>,
) -> Rev<DoublyIter<'a, T, P>>where
M: 'a,
Creates a backward iterator: Read more
Source§fn iter_links_from<'a>(&'a self, idx: &DoublyIdx<T>) -> DoublyLinkIter<'a, T, P> ⓘwhere
M: 'a,
fn iter_links_from<'a>(&'a self, idx: &DoublyIdx<T>) -> DoublyLinkIter<'a, T, P> ⓘwhere
M: 'a,
Creates a forward iterator that yields pairs of successive elements representing links: Read more
Source§fn eq_to_iter_vals<I>(&self, iter: I) -> boolwhere
I: IntoIterator<Item = T>,
T: PartialEq,
fn eq_to_iter_vals<I>(&self, iter: I) -> boolwhere
I: IntoIterator<Item = T>,
T: PartialEq,
Returns true if the elements of the iterator are equal to those of the list.
Source§fn eq_to_iter_refs<'a, I>(&self, iter: I) -> bool
fn eq_to_iter_refs<'a, I>(&self, iter: I) -> bool
Returns true if the elements of the iterator are equal to those of the list.
Source§impl<L, T, M, P> SinglyEnds<T, M, P> for L
impl<L, T, M, P> SinglyEnds<T, M, P> for L
Source§fn front<'a>(&'a self) -> Option<&'a T>where
M: 'a,
P: 'a,
fn front<'a>(&'a self) -> Option<&'a T>where
M: 'a,
P: 'a,
O(1) Returns a reference to the front of the list. Read more
Source§fn idx_err(&self, idx: &SinglyIdx<T>) -> Option<NodeIdxError>
fn idx_err(&self, idx: &SinglyIdx<T>) -> Option<NodeIdxError>
O(1) Returns a None if the given node
idx
is valid. Read moreSource§fn is_valid(&self, idx: &SinglyIdx<T>) -> bool
fn is_valid(&self, idx: &SinglyIdx<T>) -> bool
O(1) Returns whether or not the
idx
is valid for this list; i.e., Read moreSource§fn get<'a>(&'a self, idx: &SinglyIdx<T>) -> Option<&'a T>where
M: 'a,
P: 'a,
fn get<'a>(&'a self, idx: &SinglyIdx<T>) -> Option<&'a T>where
M: 'a,
P: 'a,
O(1) Returns a reference to the node with the given
idx
in constant time. Read moreSource§fn try_get<'a>(&'a self, idx: &SinglyIdx<T>) -> Result<&'a T, NodeIdxError>where
M: 'a,
P: 'a,
fn try_get<'a>(&'a self, idx: &SinglyIdx<T>) -> Result<&'a T, NodeIdxError>where
M: 'a,
P: 'a,
O(1) Returns a reference to the node with the given
idx
in constant time. Read moreSource§impl<L, T, M, P> SinglyIterable<T, M, P> for L
impl<L, T, M, P> SinglyIterable<T, M, P> for L
Source§fn iter_ptr<'a>(&'a self) -> SinglyIterPtr<'a, T, P> ⓘwhere
M: 'a,
fn iter_ptr<'a>(&'a self) -> SinglyIterPtr<'a, T, P> ⓘwhere
M: 'a,
Returns a double-ended iterator of pointers to the elements of the list from front to back.
Source§fn iter<'a>(&'a self) -> SinglyIter<'a, T, P> ⓘwhere
M: 'a,
fn iter<'a>(&'a self) -> SinglyIter<'a, T, P> ⓘwhere
M: 'a,
Returns a forward iterator to elements of the list from front to back. Read more
Source§fn indices<'a>(&'a self) -> impl Iterator<Item = SinglyIdx<T>>where
M: 'a,
T: 'a,
P: 'a,
fn indices<'a>(&'a self) -> impl Iterator<Item = SinglyIdx<T>>where
M: 'a,
T: 'a,
P: 'a,
Returns an iterator of indices of elements of the list. Read more
Source§fn pointers<'a>(&'a self) -> impl Iterator<Item = SinglyPtr<T>>where
M: 'a,
T: 'a,
P: 'a,
fn pointers<'a>(&'a self) -> impl Iterator<Item = SinglyPtr<T>>where
M: 'a,
T: 'a,
P: 'a,
Returns an iterator of pointers to the elements of the list. Read more
Source§fn iter_from<'a>(&'a self, idx: &SinglyIdx<T>) -> SinglyIter<'a, T, P> ⓘwhere
M: 'a,
fn iter_from<'a>(&'a self, idx: &SinglyIdx<T>) -> SinglyIter<'a, T, P> ⓘwhere
M: 'a,
Creates a forward iterator: Read more
Source§fn eq_to_iter_vals<I>(&self, iter: I) -> boolwhere
I: IntoIterator<Item = T>,
T: PartialEq,
fn eq_to_iter_vals<I>(&self, iter: I) -> boolwhere
I: IntoIterator<Item = T>,
T: PartialEq,
Returns true if the elements of the iterator are equal to those of the list.
Source§fn eq_to_iter_refs<'a, I>(&self, iter: I) -> bool
fn eq_to_iter_refs<'a, I>(&self, iter: I) -> bool
Returns true if the elements of the iterator are equal to those of the list.