pub struct Fuse<S> { /* private fields */ }Expand description
A stream which “fuse“s a stream once it’s terminated.
Normally streams can behave unpredictably when used after they have already
finished, but Fuse continues to return None from poll forever when
finished.
Implementations§
Source§impl<S> Fuse<S>
impl<S> Fuse<S>
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Returns whether the underlying stream has finished or not.
If this method returns true, then all future calls to poll are
guaranteed to return None. If this returns false, then the
underlying stream is still in use.
Sourcepub fn get_ref(&self) -> &S
pub fn get_ref(&self) -> &S
Acquires a reference to the underlying stream that this combinator is pulling from.
Sourcepub fn get_mut(&mut self) -> &mut S
pub fn get_mut(&mut self) -> &mut S
Acquires a mutable reference to the underlying stream 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.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes this combinator, returning the underlying stream.
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§
Source§impl<S> Sink for Fuse<S>where
S: Sink,
impl<S> Sink for Fuse<S>where
S: Sink,
Source§type SinkError = <S as Sink>::SinkError
type SinkError = <S as Sink>::SinkError
Source§fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<(), Self::SinkError>
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<(), Self::SinkError>
Sink to receive a value. Read moreSource§fn start_send(&mut self, item: Self::SinkItem) -> Result<(), Self::SinkError>
fn start_send(&mut self, item: Self::SinkItem) -> Result<(), Self::SinkError>
poll_ready which returned Ok(Async::Ready(())). Read moreAuto Trait Implementations§
impl<S> Freeze for Fuse<S>where
S: Freeze,
impl<S> RefUnwindSafe for Fuse<S>where
S: RefUnwindSafe,
impl<S> Send for Fuse<S>where
S: Send,
impl<S> Sync for Fuse<S>where
S: Sync,
impl<S> Unpin for Fuse<S>where
S: Unpin,
impl<S> UnwindSafe for Fuse<S>where
S: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> SinkExt for T
impl<T> SinkExt for T
Source§fn with<U, Fut, F>(self, f: F) -> With<Self, U, Fut, F>
fn with<U, Fut, F>(self, f: F) -> With<Self, U, Fut, F>
Source§fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, U, St, F>
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, U, St, F>
Source§fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
Source§fn sink_err_into<E>(self) -> SinkErrInto<Self, E>
fn sink_err_into<E>(self) -> SinkErrInto<Self, E>
Into trait. Read moreSource§fn buffer(self, amt: usize) -> Buffer<Self>where
Self: Sized,
fn buffer(self, amt: usize) -> Buffer<Self>where
Self: Sized,
Source§fn flush(self) -> Flush<Self>where
Self: Sized,
fn flush(self) -> Flush<Self>where
Self: Sized,
Source§fn send(self, item: Self::SinkItem) -> Send<Self>where
Self: Sized,
fn send(self, item: Self::SinkItem) -> Send<Self>where
Self: Sized,
Source§fn send_all<S>(self, stream: S) -> SendAll<Self, S>
fn send_all<S>(self, stream: S) -> SendAll<Self, S>
Source§impl<T> StreamExt for T
impl<T> StreamExt for T
Source§fn next(self) -> StreamFuture<Self>where
Self: Sized,
fn next(self) -> StreamFuture<Self>where
Self: Sized,
Future. Read moreSource§fn filter<R, P>(self, pred: P) -> Filter<Self, R, P>
fn filter<R, P>(self, pred: P) -> Filter<Self, R, P>
Source§fn filter_map<R, B, F>(self, f: F) -> FilterMap<Self, R, F>
fn filter_map<R, B, F>(self, f: F) -> FilterMap<Self, R, F>
Source§fn then<U, F>(self, f: F) -> Then<Self, U, F>
fn then<U, F>(self, f: F) -> Then<Self, U, F>
f. Read moreSource§fn and_then<U, F>(self, f: F) -> AndThen<Self, U, F>
fn and_then<U, F>(self, f: F) -> AndThen<Self, U, F>
f. Read moreSource§fn or_else<U, F>(self, f: F) -> OrElse<Self, U, F>
fn or_else<U, F>(self, f: F) -> OrElse<Self, U, F>
f. Read moreSource§fn collect<C: Default + Extend<Self::Item>>(self) -> Collect<Self, C>where
Self: Sized,
fn collect<C: Default + Extend<Self::Item>>(self) -> Collect<Self, C>where
Self: Sized,
Source§fn concat(self) -> Concat<Self>where
Self: Sized,
Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
fn concat(self) -> Concat<Self>where
Self: Sized,
Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
Source§fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F>
fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F>
Source§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn skip_while<R, P>(self, pred: P) -> SkipWhile<Self, R, P>
fn skip_while<R, P>(self, pred: P) -> SkipWhile<Self, R, P>
true. Read moreSource§fn take_while<R, P>(self, pred: P) -> TakeWhile<Self, R, P>
fn take_while<R, P>(self, pred: P) -> TakeWhile<Self, R, P>
true. Read moreSource§fn for_each<U, F>(self, f: F) -> ForEach<Self, U, F>
fn for_each<U, F>(self, f: F) -> ForEach<Self, U, F>
Source§fn for_each_concurrent<U, F>(self, f: F) -> ForEachConcurrent<Self, U, F>
fn for_each_concurrent<U, F>(self, f: F) -> ForEachConcurrent<Self, U, F>
for_each but may begin
processing an element while previous elements are still being processed. Read moreSource§fn err_into<E>(self) -> ErrInto<Self, E>
fn err_into<E>(self) -> ErrInto<Self, E>
Into trait. Read moreSource§fn take(self, amt: u64) -> Take<Self>where
Self: Sized,
fn take(self, amt: u64) -> Take<Self>where
Self: Sized,
amt items of the underlying stream. Read moreSource§fn skip(self, amt: u64) -> Skip<Self>where
Self: Sized,
fn skip(self, amt: u64) -> Skip<Self>where
Self: Sized,
amt items of the underlying stream. Read moreSource§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
poll will never again be called once it has
finished. Read moreSource§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Source§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Source§fn buffered(self, amt: usize) -> Buffered<Self>
fn buffered(self, amt: usize) -> Buffered<Self>
Source§fn buffer_unordered(self, amt: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, amt: usize) -> BufferUnordered<Self>
Source§fn zip<S>(self, other: S) -> Zip<Self, S>
fn zip<S>(self, other: S) -> Zip<Self, S>
Source§fn peekable(self) -> Peekable<Self>where
Self: Sized,
fn peekable(self) -> Peekable<Self>where
Self: Sized,
peek method. Read moreSource§fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
Source§fn select<S>(self, other: S) -> Select<Self, S>
fn select<S>(self, other: S) -> Select<Self, S>
Source§fn forward<S>(self, sink: S) -> Forward<Self, S>
fn forward<S>(self, sink: S) -> Forward<Self, S>
Source§fn split(self) -> (SplitSink<Self>, SplitStream<Self>)
fn split(self) -> (SplitSink<Self>, SplitStream<Self>)
Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
Source§fn recover<E, F>(self, f: F) -> Recover<Self, E, F>
fn recover<E, F>(self, f: F) -> Recover<Self, E, F>
Option<Self::Item>, such that a None value terminates the stream. Read more