pub struct IterSource<I: Iterator> { /* private fields */ }Expand description
Source adapter over any IntoIterator.
§Example
use pipe_io::source::{IterSource, Source};
let mut s = IterSource::new(vec![1, 2, 3]);
assert_eq!(s.pull().unwrap(), Some(1));
assert_eq!(s.pull().unwrap(), Some(2));
assert_eq!(s.pull().unwrap(), Some(3));
assert_eq!(s.pull().unwrap(), None);Implementations§
Source§impl<I> IterSource<I>where
I: Iterator,
impl<I> IterSource<I>where
I: Iterator,
Sourcepub fn new<II>(into_iter: II) -> Selfwhere
II: IntoIterator<IntoIter = I>,
pub fn new<II>(into_iter: II) -> Selfwhere
II: IntoIterator<IntoIter = I>,
Wrap an iterator into a source.
Trait Implementations§
Source§impl<I> Source for IterSource<I>where
I: Iterator,
impl<I> Source for IterSource<I>where
I: Iterator,
Source§type Error = Infallible
type Error = Infallible
Error type the source can return.
Auto Trait Implementations§
impl<I> Freeze for IterSource<I>where
I: Freeze,
impl<I> RefUnwindSafe for IterSource<I>where
I: RefUnwindSafe,
impl<I> Send for IterSource<I>where
I: Send,
impl<I> Sync for IterSource<I>where
I: Sync,
impl<I> Unpin for IterSource<I>where
I: Unpin,
impl<I> UnsafeUnpin for IterSource<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for IterSource<I>where
I: UnwindSafe,
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