pub struct HarrenRefIter<'a> { /* private fields */ }Implementations§
Source§impl HarrenRefIter<'_>
impl HarrenRefIter<'_>
Sourcepub fn peek_type(&self) -> Option<TypeId>
pub fn peek_type(&self) -> Option<TypeId>
Checks the type of the next item in the iterator without actually advancing it.
§Examples
use std::any::TypeId;
use hvec::hvec;
let list = hvec![1_u64, 2_i32];
let mut iter = list.into_iter();
assert_eq!(iter.peek_type(), Some(TypeId::of::<u64>()));Sourcepub fn next<T: 'static>(&mut self) -> Option<&T>
pub fn next<T: 'static>(&mut self) -> Option<&T>
Advances the iterator and returns the next item if one exists - or else None.
§Panics
(This method can only panic if the type_assertions feature flag is enabled.)
This method will panic if the actual type of the item
differs from the T that this method was called with.
§Examples
use hvec::hvec;
let list = hvec![1_u64, 2_i32];
let mut iter = list.into_iter();
assert_eq!(iter.next::<u64>(), Some(1_u64));
assert_eq!(iter.next::<i32>(), Some(2_i32));
assert_eq!(iter.next::<()>(), None);Sourcepub unsafe fn next_unchecked<T: 'static>(&mut self) -> Option<&T>
pub unsafe fn next_unchecked<T: 'static>(&mut self) -> Option<&T>
See Self::next. Does not panic if the type doesn’t match.
§Safety
This method is only safe if the bytes can be safely interpreted as a struct of type T.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HarrenRefIter<'a>
impl<'a> RefUnwindSafe for HarrenRefIter<'a>
impl<'a> !Send for HarrenRefIter<'a>
impl<'a> !Sync for HarrenRefIter<'a>
impl<'a> Unpin for HarrenRefIter<'a>
impl<'a> UnwindSafe for HarrenRefIter<'a>
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