Struct Iter
#[must_use = "iterators are lazy and do nothing unless consumed"]
pub struct Iter<'a, T: 'a> { pub(in ::collections::linked_list) head: Option<NonNull<Node<T>>>, pub(in ::collections::linked_list) tail: Option<NonNull<Node<T>>>, pub(in ::collections::linked_list) len: usize, pub(in ::collections::linked_list) marker: PhantomData<&'a Node<T>> }
An iterator over the elements of a LinkedList.
This struct is created by [LinkedList::iter()]. See its
documentation for more.
Fields
head: Option<NonNull<Node<T>>>tail: Option<NonNull<Node<T>>>len: usizemarker: PhantomData<&'a Node<T>>
Trait Implementations
impl<'a, T> DoubleEndedIterator for Iter<'a, T>
fn next_back(&mut self) -> Option<&'a T>
impl<'a, T> Iterator for Iter<'a, T>
type Item = &'a T;fn next(&mut self) -> Option<&'a T>fn size_hint(&self) -> (usize, Option<usize>)fn last(self) -> Option<&'a T>
impl<T> Clone for Iter<'_, T>
fn clone(&self) -> Self
impl<T> Default for Iter<'_, T>
fn default() -> SelfCreates an empty
linked_list::Iter.# use linked_list; let iter: Iter = Defaultdefault; assert_eq!;
impl<T> ExactSizeIterator for Iter<'_, T>
impl<T> FusedIterator for Iter<'_, T>
impl<T> TrustedLen for Iter<'_, T>
impl<T: Debug> Debug for Iter<'_, T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T: Sync> Send for Iter<'_, T>
impl<T: Sync> Sync for Iter<'_, T>
Auto Trait Implementations
impl<'a, T> Freeze for Iter<'a, T>
where
Option<NonNull<Node<T>>>: Freeze + Freeze,
PhantomData<&'a Node<T>>: Freeze,
impl<'a, T> RefUnwindSafe for Iter<'a, T>
where
Option<NonNull<Node<T>>>: RefUnwindSafe + RefUnwindSafe,
PhantomData<&'a Node<T>>: RefUnwindSafe,
impl<'a, T> Unpin for Iter<'a, T>
where
Option<NonNull<Node<T>>>: Unpin + Unpin,
PhantomData<&'a Node<T>>: Unpin,
impl<'a, T> UnsafeUnpin for Iter<'a, T>
where
Option<NonNull<Node<T>>>: UnsafeUnpin + UnsafeUnpin,
PhantomData<&'a Node<T>>: UnsafeUnpin,
impl<'a, T> UnwindSafe for Iter<'a, T>
where
Option<NonNull<Node<T>>>: UnwindSafe + UnwindSafe,
PhantomData<&'a Node<T>>: UnwindSafe,
Blanket Implementations
impl<I> IntoIterator for Iter<'a, T>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for Iter<'a, T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Iter<'a, T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Iter<'a, T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Iter<'a, T>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Iter<'a, T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Iter<'a, T>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Iter<'a, T>
impl<T> ToOwned for Iter<'a, T>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Iter<'a, T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Iter<'a, T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Iter<'a, T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>