pub struct ControlledStream<H, S, T, F>where
H: ControlHandler,
S: Stream<Item = Multipart, Error = F>,
T: Stream<Item = Multipart, Error = F>,{ /* private fields */ }Expand description
ControlledStreams are used when you want a stream of multiparts, but you want to be able to
turn it off.
It contains a handler that implements the ControlHandler trait. This trait contains a single
method should_stop, that determines whether or not the given stream should stop producing
values.
Implementations§
Source§impl<H, S, T, F> ControlledStream<H, S, T, F>where
H: ControlHandler,
S: Stream<Item = Multipart, Error = F>,
T: Stream<Item = Multipart, Error = F>,
impl<H, S, T, F> ControlledStream<H, S, T, F>where
H: ControlHandler,
S: Stream<Item = Multipart, Error = F>,
T: Stream<Item = Multipart, Error = F>,
Sourcepub fn new(stream: T, control: S, handler: H) -> ControlledStream<H, S, T, F>
pub fn new(stream: T, control: S, handler: H) -> ControlledStream<H, S, T, F>
Create a new ControlledStream.
This shouldn’t be called directly. A socket wrapper type’s controlled method, if present,
will perform the required actions to create and encapsulate this type.
Trait Implementations§
Source§impl<H, S, T, F> Stream for ControlledStream<H, S, T, F>where
H: ControlHandler,
S: Stream<Item = Multipart, Error = F>,
T: Stream<Item = Multipart, Error = F>,
impl<H, S, T, F> Stream for ControlledStream<H, S, T, F>where
H: ControlHandler,
S: Stream<Item = Multipart, Error = F>,
T: Stream<Item = Multipart, Error = F>,
Source§fn poll(&mut self) -> Result<Async<Option<Multipart>>, F>
fn poll(&mut self) -> Result<Async<Option<Multipart>>, F>
Poll the control stream, if it isn’t ready, poll the producing stream
If the control stream is ready, but has ended, stop the producting stream.
If the control stream is ready with a Multipart, use the ControlHandler
to determine if the producting stream should be stopped.
Source§fn wait(self) -> Wait<Self>where
Self: Sized,
fn wait(self) -> Wait<Self>where
Self: Sized,
Source§fn into_future(self) -> StreamFuture<Self>where
Self: Sized,
fn into_future(self) -> StreamFuture<Self>where
Self: Sized,
Future. Read moreSource§fn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
Source§fn filter_map<F, B>(self, f: F) -> FilterMap<Self, F>
fn filter_map<F, B>(self, f: F) -> FilterMap<Self, F>
Source§fn then<F, U>(self, f: F) -> Then<Self, F, U>
fn then<F, U>(self, f: F) -> Then<Self, F, U>
f. Read moreSource§fn and_then<F, U>(self, f: F) -> AndThen<Self, F, U>
fn and_then<F, U>(self, f: F) -> AndThen<Self, F, U>
f. Read moreSource§fn or_else<F, U>(self, f: F) -> OrElse<Self, F, U>
fn or_else<F, U>(self, f: F) -> OrElse<Self, F, U>
f. Read moreSource§fn collect(self) -> Collect<Self>where
Self: Sized,
fn collect(self) -> Collect<Self>where
Self: Sized,
Source§fn fold<F, T, Fut>(self, init: T, f: F) -> Fold<Self, F, Fut, T>where
F: FnMut(T, Self::Item) -> Fut,
Fut: IntoFuture<Item = T>,
Self::Error: From<<Fut as IntoFuture>::Error>,
Self: Sized,
fn fold<F, T, Fut>(self, init: T, f: F) -> Fold<Self, F, Fut, T>where
F: FnMut(T, Self::Item) -> Fut,
Fut: IntoFuture<Item = T>,
Self::Error: From<<Fut as IntoFuture>::Error>,
Self: Sized,
Source§fn skip_while<P, R>(self, pred: P) -> SkipWhile<Self, P, R>
fn skip_while<P, R>(self, pred: P) -> SkipWhile<Self, P, R>
true. Read moreSource§fn take_while<P, R>(self, pred: P) -> TakeWhile<Self, P, R>
fn take_while<P, R>(self, pred: P) -> TakeWhile<Self, P, R>
true. Read moreSource§fn for_each<F, U>(self, f: F) -> ForEach<Self, F, U>
fn for_each<F, U>(self, f: F) -> ForEach<Self, F, U>
Source§fn from_err<E>(self) -> FromErr<Self, E>
fn from_err<E>(self) -> FromErr<Self, E>
From for
this stream’s Error, returning a new stream. 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 merge<S>(self, other: S) -> Merge<Self, S>
fn merge<S>(self, other: S) -> Merge<Self, S>
select nowSource§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 more