Struct Zip

#[must_use = "streams do nothing unless polled"]
pub struct Zip<St1: Stream, St2: Stream> { /* private fields */ }

Stream for the zip method.

Implementations

impl<St1: Stream, St2: Stream> Zip<St1, St2>

fn get_ref(&self) -> (&St1, &St2)

Acquires a reference to the underlying streams that this combinator is pulling from.

fn get_mut(&mut self) -> (&mut St1, &mut St2)

Acquires a mutable reference to the underlying streams that this combinator is pulling from.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.

fn get_pin_mut(self: Pin<&mut Self>) -> (Pin<&mut St1>, Pin<&mut St2>)

Acquires a pinned mutable reference to the underlying streams that this combinator is pulling from.

Note that care must be taken to avoid tampering with the state of the stream which may otherwise confuse this combinator.

fn into_inner(self) -> (St1, St2)

Consumes this combinator, returning the underlying streams.

Note that this may discard intermediate state of this combinator, so care should be taken to avoid losing resources when this is called.

Trait Implementations

impl<'__pin, St1: Stream, St2: Stream> Unpin for Zip<St1, St2> where PinnedFieldsOf<__Origin<'__pin, St1, St2>>: Unpin,

impl<St1, St2> FusedStream for Zip<St1, St2> where St1: Stream, St2: Stream,

fn is_terminated(&self) -> bool

impl<St1, St2> Stream for Zip<St1, St2> where St1: Stream, St2: Stream,

type Item = (<St1 as Stream>::Item, <St2 as Stream>::Item);
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
fn size_hint(&self) -> (usize, Option<usize>)

impl<St1: Debug + Stream, St2: Debug + Stream> Debug for Zip<St1, St2> where St1::Item: Debug, St2::Item: Debug,

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<St1, St2> Freeze for Zip<St1, St2> where Fuse<St1>: Freeze, Fuse<St2>: Freeze, Option<<St1 as Stream>::Item>: Freeze, Option<<St2 as Stream>::Item>: Freeze,

impl<St1, St2> RefUnwindSafe for Zip<St1, St2> where Fuse<St1>: RefUnwindSafe, Fuse<St2>: RefUnwindSafe, Option<<St1 as Stream>::Item>: RefUnwindSafe, Option<<St2 as Stream>::Item>: RefUnwindSafe,

impl<St1, St2> Send for Zip<St1, St2> where Fuse<St1>: Send, Fuse<St2>: Send, Option<<St1 as Stream>::Item>: Send, Option<<St2 as Stream>::Item>: Send,

impl<St1, St2> Sync for Zip<St1, St2> where Fuse<St1>: Sync, Fuse<St2>: Sync, Option<<St1 as Stream>::Item>: Sync, Option<<St2 as Stream>::Item>: Sync,

impl<St1, St2> UnsafeUnpin for Zip<St1, St2> where Fuse<St1>: UnsafeUnpin, Fuse<St2>: UnsafeUnpin, Option<<St1 as Stream>::Item>: UnsafeUnpin, Option<<St2 as Stream>::Item>: UnsafeUnpin,

impl<St1, St2> UnwindSafe for Zip<St1, St2> where Fuse<St1>: UnwindSafe, Fuse<St2>: UnwindSafe, Option<<St1 as Stream>::Item>: UnwindSafe, Option<<St2 as Stream>::Item>: UnwindSafe,

Blanket Implementations

impl<T> Any for Zip<St1, St2> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Zip<St1, St2> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Zip<St1, St2> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for Zip<St1, St2>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> StreamExt for Zip<St1, St2> where T: Stream + ?Sized,

impl<T, U> Into<U> for Zip<St1, St2> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Zip<St1, St2> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Zip<St1, St2> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>