Struct ipfs_embed_net::SyncQuery [−][src]
pub struct SyncQuery<P: StoreParams> { /* fields omitted */ }
A bitswap
sync query.
Trait Implementations
impl<P: StoreParams> Drop for SyncQuery<P>
[src][+]
fn drop(&mut self)
[src][−]
Executes the destructor for this type. Read more
impl<P: StoreParams> Future for SyncQuery<P>
[src][+]
type Output = Result<()>
The type of value produced on completion.
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>
[src][−]
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
impl<P: StoreParams> Stream for SyncQuery<P>
[src][+]
type Item = SyncEvent
Values yielded by the stream.
fn poll_next(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
[src][−]
mut self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>>
Attempt to pull out the next value of this stream, registering the
current task for wakeup if the value is not yet available, and returning
None
if the stream is exhausted. Read more
pub fn size_hint(&self) -> (usize, Option<usize>)
[−]
Returns the bounds on the remaining length of the stream. Read more
Auto Trait Implementations
impl<P> !RefUnwindSafe for SyncQuery<P>
[src]
impl<P> Send for SyncQuery<P>
[src]
impl<P> Sync for SyncQuery<P>
[src]
impl<P> Unpin for SyncQuery<P>
[src]
impl<P> !UnwindSafe for SyncQuery<P>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
pub fn type_id(&self) -> TypeId
[src][−]
Gets the TypeId
of self
. Read more
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow(&self) -> &T
[src][−]
Immutably borrows from an owned value. Read more
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src][−]
Mutably borrows from an owned value. Read more
impl<T> From<T> for T
[src][+]
impl<T> FutureExt for T where
T: Future + ?Sized,
[+]
T: Future + ?Sized,
pub fn map<U, F>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output) -> U,
[−]
F: FnOnce(Self::Output) -> U,
Map this future's output to a different type, returning a new future of the resulting type. Read more
pub fn map_into<U>(self) -> MapInto<Self, U> where
Self::Output: Into<U>,
[−]
Self::Output: Into<U>,
Map this future's output to a different type, returning a new future of the resulting type. Read more
pub fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> where
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
[−]
F: FnOnce(Self::Output) -> Fut,
Fut: Future,
Chain on a computation for when a future finished, passing the result of
the future to the provided closure f
. Read more
pub fn left_future<B>(self) -> Either<Self, B> where
B: Future<Output = Self::Output>,
[−]
B: Future<Output = Self::Output>,
Wrap this future in an Either
future, making it the left-hand variant
of that Either
. Read more
pub fn right_future<A>(self) -> Either<A, Self> where
A: Future<Output = Self::Output>,
[−]
A: Future<Output = Self::Output>,
Wrap this future in an Either
future, making it the right-hand variant
of that Either
. Read more
pub fn into_stream(self) -> IntoStream<Self>
[−]
Convert this future into a single element stream. Read more
pub fn flatten(self) -> Flatten<Self> where
Self::Output: Future,
[−]
Self::Output: Future,
Flatten the execution of this future when the output of this future is itself another future. Read more
pub fn flatten_stream(self) -> FlattenStream<Self> where
Self::Output: Stream,
[−]
Self::Output: Stream,
Flatten the execution of this future when the successful result of this future is a stream. Read more
pub fn fuse(self) -> Fuse<Self>
[−]
Fuse a future such that poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read more
pub fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Output),
[−]
F: FnOnce(&Self::Output),
Do something with the output of a future before passing it on. Read more
pub fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[−]
Self: UnwindSafe,
Catches unwinding panics while polling the future. Read more
pub fn shared(self) -> Shared<Self> where
Self::Output: Clone,
[−]
Self::Output: Clone,
Create a cloneable handle to this future where all handles will resolve to the same result. Read more
pub fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
[−]
Turn this future into a future that yields ()
on completion and sends
its output to another future on a separate task. Read more
pub fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send, Global>> where
Self: Send + 'a,
[−]
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send, Global>> where
Self: Send + 'a,
Wrap the future in a Box, pinning it. Read more
pub fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>> where
Self: 'a,
[−]
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>> where
Self: 'a,
Wrap the future in a Box, pinning it. Read more
pub fn unit_error(self) -> UnitError<Self>
[−]
Turns a Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>. Read more
pub fn never_error(self) -> NeverError<Self>
[−]
Turns a Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>. Read more
pub fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output> where
Self: Unpin,
[−]
Self: Unpin,
A convenience for calling Future::poll
on Unpin
future types.
pub fn now_or_never(self) -> Option<Self::Output>
[−]
Evaluates and consumes the future, returning the resulting output if
the future is ready after the first call to Future::poll
. Read more
impl<F> FutureExt for F where
F: Future + ?Sized,
[+]
F: Future + ?Sized,
pub fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output> where
Self: Unpin,
[−]
Self: Unpin,
A convenience for calling Future::poll()
on !
Unpin
types.
pub fn or<F>(self, other: F) -> Or<Self, F> where
F: Future<Output = Self::Output>,
[−]
F: Future<Output = Self::Output>,
Returns the result of self
or other
future, preferring self
if both are ready. Read more
pub fn race<F>(self, other: F) -> Race<Self, F> where
F: Future<Output = Self::Output>,
[−]
F: Future<Output = Self::Output>,
Returns the result of self
or other
future, with no preference if both are ready. Read more
pub fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[−]
Self: UnwindSafe,
Catches panics while polling the future. Read more
pub fn boxed<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send, Global>> where
Self: Send + 'a,
[−]
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a + Send, Global>> where
Self: Send + 'a,
Boxes the future and changes its type to dyn Future + Send + 'a
. Read more
pub fn boxed_local<'a>(
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>> where
Self: 'a,
[−]
self
) -> Pin<Box<dyn Future<Output = Self::Output> + 'a, Global>> where
Self: 'a,
Boxes the future and changes its type to dyn Future + 'a
. Read more
impl<T> Instrument for T
[src][+]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src][−]
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn in_current_span(self) -> Instrumented<Self>
[src][−]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<F> IntoFuture for F where
F: Future,
[src][+]
F: Future,
type Output = <F as Future>::Output
into_future
)The output that the future will produce on completion.
type Future = F
into_future
)Which kind of future are we turning this into?
pub fn into_future(self) -> <F as IntoFuture>::Future
[src][−]
into_future
)Creates a future from a value.
impl<T> References<RawCodec> for T
[+]
pub fn references<R, E>(
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
[−]
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
Scrape the references from an impl Read
. Read more
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> StreamExt for T where
T: Stream + ?Sized,
[+]
T: Stream + ?Sized,
pub fn next(&mut self) -> Next<'_, Self> where
Self: Unpin,
[−]
Self: Unpin,
Creates a future that resolves to the next item in the stream. Read more
pub fn into_future(self) -> StreamFuture<Self> where
Self: Unpin,
[−]
Self: Unpin,
Converts this stream into a future of (next_item, tail_of_stream)
.
If the stream terminates, then the next item is None
. Read more
pub fn map<T, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> T,
[−]
F: FnMut(Self::Item) -> T,
Maps this stream's items to a different type, returning a new stream of the resulting type. Read more
pub fn enumerate(self) -> Enumerate<Self>
[−]
Creates a stream which gives the current iteration count as well as the next value. Read more
pub fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F> where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
[−]
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Filters the values produced by this stream according to the provided asynchronous predicate. Read more
pub fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F> where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = Option<T>>,
[−]
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = Option<T>>,
Filters the values produced by this stream while simultaneously mapping them to a different type according to the provided asynchronous closure. Read more
pub fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> where
F: FnMut(Self::Item) -> Fut,
Fut: Future,
[−]
F: FnMut(Self::Item) -> Fut,
Fut: Future,
Computes from this stream's items new items of a different type using an asynchronous closure. Read more
pub fn collect<C>(self) -> Collect<Self, C> where
C: Default + Extend<Self::Item>,
[−]
C: Default + Extend<Self::Item>,
Transforms a stream into a collection, returning a future representing the result of that computation. Read more
pub fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> where
Self: Stream<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
[−]
Self: Stream<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Converts a stream of pairs into a future, which resolves to pair of containers. Read more
pub fn concat(self) -> Concat<Self> where
Self::Item: Extend<<Self::Item as IntoIterator>::Item>,
Self::Item: IntoIterator,
Self::Item: Default,
[−]
Self::Item: Extend<<Self::Item as IntoIterator>::Item>,
Self::Item: IntoIterator,
Self::Item: Default,
Concatenate all items of a stream into a single extendable destination, returning a future representing the end result. Read more
pub fn cycle(self) -> Cycle<Self> where
Self: Clone,
[−]
Self: Clone,
Repeats a stream endlessly. Read more
pub fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> where
F: FnMut(T, Self::Item) -> Fut,
Fut: Future<Output = T>,
[−]
F: FnMut(T, Self::Item) -> Fut,
Fut: Future<Output = T>,
Execute an accumulating asynchronous computation over a stream, collecting all the values into one final result. Read more
pub fn flatten(self) -> Flatten<Self> where
Self::Item: Stream,
[−]
Self::Item: Stream,
Flattens a stream of streams into just one continuous stream. Read more
pub fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
F: FnMut(Self::Item) -> U,
U: Stream,
[−]
F: FnMut(Self::Item) -> U,
U: Stream,
Maps a stream like [StreamExt::map
] but flattens nested Stream
s. Read more
pub fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F> where
F: FnMut(&mut S, Self::Item) -> Fut,
Fut: Future<Output = Option<B>>,
[−]
F: FnMut(&mut S, Self::Item) -> Fut,
Fut: Future<Output = Option<B>>,
Combinator similar to [StreamExt::fold
] that holds internal state
and produces a new stream. Read more
pub fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F> where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
[−]
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Skip elements on this stream while the provided asynchronous predicate
resolves to true
. Read more
pub fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F> where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
[−]
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Take elements from this stream while the provided asynchronous predicate
resolves to true
. Read more
pub fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut> where
Fut: Future,
[−]
Fut: Future,
Take elements from this stream until the provided future resolves. Read more
pub fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = ()>,
[−]
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = ()>,
Runs this stream to completion, executing the provided asynchronous closure for each element on the stream. Read more
pub fn for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F
) -> ForEachConcurrent<Self, Fut, F> where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = ()>,
[−]
self,
limit: impl Into<Option<usize>>,
f: F
) -> ForEachConcurrent<Self, Fut, F> where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = ()>,
Runs this stream to completion, executing the provided asynchronous closure for each element on the stream concurrently as elements become available. Read more
pub fn take(self, n: usize) -> Take<Self>
[−]
Creates a new stream of at most n
items of the underlying stream. Read more
pub fn skip(self, n: usize) -> Skip<Self>
[−]
Creates a new stream which skips n
items of the underlying stream. Read more
pub fn fuse(self) -> Fuse<Self>
[−]
Fuse a stream such that poll_next
will never
again be called once it has finished. This method can be used to turn
any Stream
into a FusedStream
. Read more
pub fn by_ref(&mut self) -> &mut Self
[−]
Borrows a stream, rather than consuming it. Read more
pub fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[−]
Self: UnwindSafe,
Catches unwinding panics while polling the stream. Read more
pub fn boxed<'a>(
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a + Send, Global>> where
Self: Send + 'a,
[−]
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a + Send, Global>> where
Self: Send + 'a,
Wrap the stream in a Box, pinning it. Read more
pub fn boxed_local<'a>(
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a, Global>> where
Self: 'a,
[−]
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a, Global>> where
Self: 'a,
Wrap the stream in a Box, pinning it. Read more
pub fn buffered(self, n: usize) -> Buffered<Self> where
Self::Item: Future,
[−]
Self::Item: Future,
An adaptor for creating a buffered list of pending futures. Read more
pub fn buffer_unordered(self, n: usize) -> BufferUnordered<Self> where
Self::Item: Future,
[−]
Self::Item: Future,
An adaptor for creating a buffered list of pending futures (unordered). Read more
pub fn zip<St>(self, other: St) -> Zip<Self, St> where
St: Stream,
[−]
St: Stream,
An adapter for zipping two streams together. Read more
pub fn chain<St>(self, other: St) -> Chain<Self, St> where
St: Stream<Item = Self::Item>,
[−]
St: Stream<Item = Self::Item>,
Adapter for chaining two streams. Read more
pub fn peekable(self) -> Peekable<Self>
[−]
Creates a new stream which exposes a peek
method. Read more
pub fn chunks(self, capacity: usize) -> Chunks<Self>
[−]
An adaptor for chunking up items of the stream inside a vector. Read more
pub fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>
[−]
An adaptor for chunking up ready items of the stream inside a vector. Read more
pub fn forward<S>(self, sink: S) -> Forward<Self, S> where
Self: TryStream,
S: Sink<Self::Ok, Error = Self::Error>,
[−]
Self: TryStream,
S: Sink<Self::Ok, Error = Self::Error>,
A future that completes after the given stream has been fully processed into the sink and the sink has been flushed and closed. Read more
pub fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>) where
Self: Sink<Item>,
[−]
Self: Sink<Item>,
Splits this Stream + Sink
object into separate Sink
and Stream
objects. Read more
pub fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnMut(&Self::Item),
[−]
F: FnMut(&Self::Item),
Do something with each item of this stream, afterwards passing it on. Read more
pub fn left_stream<B>(self) -> Either<Self, B> where
B: Stream<Item = Self::Item>,
[−]
B: Stream<Item = Self::Item>,
Wrap this stream in an Either
stream, making it the left-hand variant
of that Either
. Read more
pub fn right_stream<B>(self) -> Either<B, Self> where
B: Stream<Item = Self::Item>,
[−]
B: Stream<Item = Self::Item>,
Wrap this stream in an Either
stream, making it the right-hand variant
of that Either
. Read more
pub fn poll_next_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>> where
Self: Unpin,
[−]
&mut self,
cx: &mut Context<'_>
) -> Poll<Option<Self::Item>> where
Self: Unpin,
pub fn select_next_some(&mut self) -> SelectNextSome<'_, Self> where
Self: Unpin + FusedStream,
[−]
Self: Unpin + FusedStream,
impl<S> StreamExt for S where
S: Stream + ?Sized,
[+]
S: Stream + ?Sized,
pub fn poll_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> where
Self: Unpin,
[−]
Self: Unpin,
A convenience for calling [Stream::poll_next()
] on !
Unpin
types.
pub fn next(&mut self) -> NextFuture<'_, Self> where
Self: Unpin,
[−]
Self: Unpin,
Retrieves the next item in the stream. Read more
pub fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self> where
Self: Stream<Item = Result<T, E>> + Unpin,
[−]
Self: Stream<Item = Result<T, E>> + Unpin,
Retrieves the next item in the stream. Read more
pub fn count(self) -> CountFuture<Self>
[−]
Counts the number of items in the stream. Read more
pub fn map<T, F>(self, f: F) -> Map<Self, F> where
F: FnMut(Self::Item) -> T,
[−]
F: FnMut(Self::Item) -> T,
Maps items of the stream to new values using a closure. Read more
pub fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> where
F: FnMut(Self::Item) -> U,
U: Stream,
[−]
F: FnMut(Self::Item) -> U,
U: Stream,
Maps items to streams and then concatenates them. Read more
pub fn flatten(self) -> Flatten<Self> where
Self::Item: Stream,
[−]
Self::Item: Stream,
Concatenates inner streams. Read more
pub fn then<F, Fut>(self, f: F) -> Then<Self, F, Fut> where
F: FnMut(Self::Item) -> Fut,
Fut: Future,
[−]
F: FnMut(Self::Item) -> Fut,
Fut: Future,
Maps items of the stream to new values using an async closure. Read more
pub fn filter<P>(self, predicate: P) -> Filter<Self, P> where
P: FnMut(&Self::Item) -> bool,
[−]
P: FnMut(&Self::Item) -> bool,
Keeps items of the stream for which predicate
returns true
. Read more
pub fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F> where
F: FnMut(Self::Item) -> Option<T>,
[−]
F: FnMut(Self::Item) -> Option<T>,
Filters and maps items of the stream using a closure. Read more
pub fn take(self, n: usize) -> Take<Self>
[−]
Takes only the first n
items of the stream. Read more
pub fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
[−]
P: FnMut(&Self::Item) -> bool,
Takes items while predicate
returns true
. Read more
pub fn skip(self, n: usize) -> Skip<Self>
[−]
Skips the first n
items of the stream. Read more
pub fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> where
P: FnMut(&Self::Item) -> bool,
[−]
P: FnMut(&Self::Item) -> bool,
Skips items while predicate
returns true
. Read more
pub fn step_by(self, step: usize) -> StepBy<Self>
[−]
Yields every step
th item. Read more
pub fn chain<U>(self, other: U) -> Chain<Self, U> where
U: Stream<Item = Self::Item>,
[−]
U: Stream<Item = Self::Item>,
Appends another stream to the end of this one. Read more
pub fn cloned<'a, T>(self) -> Cloned<Self> where
Self: Stream<Item = &'a T>,
T: Clone + 'a,
[−]
Self: Stream<Item = &'a T>,
T: Clone + 'a,
Clones all items. Read more
pub fn copied<'a, T>(self) -> Copied<Self> where
Self: Stream<Item = &'a T>,
T: Copy + 'a,
[−]
Self: Stream<Item = &'a T>,
T: Copy + 'a,
Copies all items. Read more
pub fn collect<C>(self) -> CollectFuture<Self, C> where
C: Default + Extend<Self::Item>,
[−]
C: Default + Extend<Self::Item>,
Collects all items in the stream into a collection. Read more
pub fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C> where
Self: Stream<Item = Result<T, E>>,
C: Default + Extend<T>,
[−]
Self: Stream<Item = Result<T, E>>,
C: Default + Extend<T>,
Collects all items in the fallible stream into a collection. Read more
pub fn partition<B, P>(self, predicate: P) -> PartitionFuture<Self, P, B> where
P: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
[−]
P: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
Partitions items into those for which predicate
is true
and those for which it is
false
, and then collects them into two collections. Read more
pub fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T> where
F: FnMut(T, Self::Item) -> T,
[−]
F: FnMut(T, Self::Item) -> T,
Accumulates a computation over the stream. Read more
pub fn try_fold<T, E, F, B>(
&mut self,
init: B,
f: F
) -> TryFoldFuture<'_, Self, F, B> where
Self: Stream<Item = Result<T, E>> + Unpin,
F: FnMut(B, T) -> Result<B, E>,
[−]
&mut self,
init: B,
f: F
) -> TryFoldFuture<'_, Self, F, B> where
Self: Stream<Item = Result<T, E>> + Unpin,
F: FnMut(B, T) -> Result<B, E>,
Accumulates a fallible computation over the stream. Read more
pub fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> where
F: FnMut(&mut St, Self::Item) -> Option<B>,
[−]
F: FnMut(&mut St, Self::Item) -> Option<B>,
Maps items of the stream to new values using a state value and a closure. Read more
pub fn fuse(self) -> Fuse<Self>
[−]
pub fn cycle(self) -> Cycle<Self> where
Self: Clone,
[−]
Self: Clone,
Repeats the stream from beginning to end, forever. Read more
pub fn enumerate(self) -> Enumerate<Self>
[−]
Enumerates items, mapping them to (index, item)
. Read more
pub fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnMut(&Self::Item),
[−]
F: FnMut(&Self::Item),
Calls a closure on each item and passes it on. Read more
pub fn nth(&mut self, n: usize) -> NthFuture<'_, Self> where
Self: Unpin,
[−]
Self: Unpin,
Gets the n
th item of the stream. Read more
pub fn last(self) -> LastFuture<Self>
[−]
Returns the last item in the stream. Read more
pub fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P> where
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
[−]
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
Finds the first item of the stream for which predicate
returns true
. Read more
pub fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F> where
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
[−]
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
pub fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P> where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[−]
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Finds the index of the first item of the stream for which predicate
returns true
. Read more
pub fn all<P>(&mut self, predicate: P) -> AllFuture<'_, Self, P> where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[−]
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Tests if predicate
returns true
for all items in the stream. Read more
pub fn any<P>(&mut self, predicate: P) -> AnyFuture<'_, Self, P> where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
[−]
Self: Unpin,
P: FnMut(Self::Item) -> bool,
Tests if predicate
returns true
for any item in the stream. Read more
pub fn for_each<F>(self, f: F) -> ForEachFuture<Self, F> where
F: FnMut(Self::Item),
[−]
F: FnMut(Self::Item),
Calls a closure on each item of the stream. Read more
pub fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F> where
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
[−]
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
Calls a fallible closure on each item of the stream, stopping on first error. Read more
pub fn zip<U>(self, other: U) -> Zip<Self, U> where
U: Stream,
[−]
U: Stream,
Zips up two streams into a single stream of pairs. Read more
pub fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB> where
Self: Stream<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
[−]
Self: Stream<Item = (A, B)>,
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Collects a stream of pairs into a pair of collections. Read more
pub fn or<S>(self, other: S) -> Or<Self, S> where
S: Stream<Item = Self::Item>,
[−]
S: Stream<Item = Self::Item>,
Merges with other
stream, preferring items from self
whenever both streams are ready. Read more
pub fn race<S>(self, other: S) -> Race<Self, S> where
S: Stream<Item = Self::Item>,
[−]
S: Stream<Item = Self::Item>,
Merges with other
stream, with no preference for either stream when both are ready. Read more
pub fn boxed<'a>(
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a + Send, Global>> where
Self: Send + 'a,
[−]
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a + Send, Global>> where
Self: Send + 'a,
Boxes the stream and changes its type to dyn Stream + Send + 'a
. Read more
pub fn boxed_local<'a>(
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a, Global>> where
Self: 'a,
[−]
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a, Global>> where
Self: 'a,
Boxes the stream and changes its type to dyn Stream + 'a
. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
Performs the conversion.
impl<F, T, E> TryFuture for F where
F: Future<Output = Result<T, E>> + ?Sized,
[+]
F: Future<Output = Result<T, E>> + ?Sized,
type Ok = T
The type of successful values yielded by this future
type Error = E
The type of failures yielded by this future
pub fn try_poll(
self: Pin<&mut F>,
cx: &mut Context<'_>
) -> Poll<<F as Future>::Output>
[−]
self: Pin<&mut F>,
cx: &mut Context<'_>
) -> Poll<<F as Future>::Output>
Poll this TryFuture
as if it were a Future
. Read more
impl<Fut> TryFutureExt for Fut where
Fut: TryFuture + ?Sized,
[+]
Fut: TryFuture + ?Sized,
pub fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok> where
Self::Ok: Sink<Item>,
<Self::Ok as Sink<Item>>::Error == Self::Error,
[−]
Self::Ok: Sink<Item>,
<Self::Ok as Sink<Item>>::Error == Self::Error,
Flattens the execution of this future when the successful result of this
future is a [Sink
]. Read more
pub fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> where
F: FnOnce(Self::Ok) -> T,
[−]
F: FnOnce(Self::Ok) -> T,
Maps this future's success value to a different value. Read more
pub fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> where
E: FnOnce(Self::Error) -> T,
F: FnOnce(Self::Ok) -> T,
[−]
E: FnOnce(Self::Error) -> T,
F: FnOnce(Self::Ok) -> T,
Maps this future's success value to a different value, and permits for error handling resulting in the same type. Read more
pub fn map_err<E, F>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
[−]
F: FnOnce(Self::Error) -> E,
Maps this future's error value to a different value. Read more
pub fn err_into<E>(self) -> ErrInto<Self, E> where
Self::Error: Into<E>,
[−]
Self::Error: Into<E>,
pub fn ok_into<U>(self) -> OkInto<Self, U> where
Self::Ok: Into<U>,
[−]
Self::Ok: Into<U>,
pub fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> where
F: FnOnce(Self::Ok) -> Fut,
Fut: TryFuture<Error = Self::Error>,
[−]
F: FnOnce(Self::Ok) -> Fut,
Fut: TryFuture<Error = Self::Error>,
Executes another future after this one resolves successfully. The success value is passed to a closure to create this subsequent future. Read more
pub fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> where
F: FnOnce(Self::Error) -> Fut,
Fut: TryFuture<Ok = Self::Ok>,
[−]
F: FnOnce(Self::Error) -> Fut,
Fut: TryFuture<Ok = Self::Ok>,
Executes another future if this one resolves to an error. The error value is passed to a closure to create this subsequent future. Read more
pub fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> where
F: FnOnce(&Self::Ok),
[−]
F: FnOnce(&Self::Ok),
Do something with the success value of a future before passing it on. Read more
pub fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> where
F: FnOnce(&Self::Error),
[−]
F: FnOnce(&Self::Error),
Do something with the error value of a future before passing it on. Read more
pub fn try_flatten(self) -> TryFlatten<Self, Self::Ok> where
Self::Ok: TryFuture,
<Self::Ok as TryFuture>::Error == Self::Error,
[−]
Self::Ok: TryFuture,
<Self::Ok as TryFuture>::Error == Self::Error,
Flatten the execution of this future when the successful result of this future is another future. Read more
pub fn try_flatten_stream(self) -> TryFlattenStream<Self> where
Self::Ok: TryStream,
<Self::Ok as TryStream>::Error == Self::Error,
[−]
Self::Ok: TryStream,
<Self::Ok as TryStream>::Error == Self::Error,
Flatten the execution of this future when the successful result of this future is a stream. Read more
pub fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> where
F: FnOnce(Self::Error) -> Self::Ok,
[−]
F: FnOnce(Self::Error) -> Self::Ok,
Unwraps this future's ouput, producing a future with this future's
Ok
type as its
Output
type. Read more
pub fn into_future(self) -> IntoFuture<Self>
[−]
pub fn try_poll_unpin(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Self::Ok, Self::Error>> where
Self: Unpin,
[−]
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<Self::Ok, Self::Error>> where
Self: Unpin,
impl<F> TryFutureExt for F where
F: TryFuture,
[+]
F: TryFuture,
pub fn timeout(self, dur: Duration) -> Timeout<Self> where
Self::Error: From<Error>,
[−]
Self::Error: From<Error>,
Creates a new future which will take at most dur
time to resolve from
the point at which this method is called. Read more
pub fn timeout_at(self, at: Instant) -> Timeout<Self> where
Self::Error: From<Error>,
[−]
Self::Error: From<Error>,
Creates a new future which will resolve no later than at
specified. Read more
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
Performs the conversion.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,