pub struct Subscription<T: StreamDecoder<T>> { /* private fields */ }Expand description
Asynchronous subscription for streaming data.
Subscription<T> implements futures::Stream with
Item = Result<SubscriptionItem<T>, Error>:
None— the stream has ended.Some(Ok(SubscriptionItem::Data(t)))— a decoded value.Some(Ok(SubscriptionItem::Notice(n)))— a non-fatal IB notice (a warning code inWARNING_CODE_RANGEor order-cancel code 202) carried on this subscription’srequest_id; the stream stays open.Some(Err(e))— terminal error; subsequent calls returnNone.
Consume via StreamExt:
let client = Client::connect("127.0.0.1:4002", 100).await?;
let contract = Contract::stock("AAPL").build();
let mut subscription = client.market_data(&contract).subscribe().await?;
while let Some(item) = subscription.next().await {
match item {
Ok(SubscriptionItem::Data(tick)) => println!("tick: {tick:?}"),
Ok(SubscriptionItem::Notice(n)) => eprintln!("notice: {n}"),
Err(e) => { eprintln!("error: {e}"); break; }
}
}Dropping sends the cancel from a task spawned on the client’s runtime, so a subscription may be dropped on any thread, including one with no Tokio runtime. If the client’s runtime has shut down, nothing is sent: the connection went with it.
Clones share the request: dropping a clone only ends that handle, and the
request is cancelled when the last clone is dropped. For a shared stream the
clones count as one subscription. cancel on any clone ends
the request for every clone; cancel_and_drain
writes the cancel while the other clones keep reading up to TWS’s end.
When you only care about data, use the SubscriptionItemStreamExt::filter_data
adapter to filter notices (logged at warn!):
let mut data = subscription.filter_data();
while let Some(result) = data.next().await { /* result: Result<TickTypes, _> */ }Notices that are not tied to a specific subscription — connectivity codes
1100/1101/1102, farm-status 2104/2105/2106/2107/2108, etc. — are not delivered
here. Subscribe to them via Client::notice_stream
instead.
Implementations§
Source§impl<T: StreamDecoder<T>> Subscription<T>
impl<T: StreamDecoder<T>> Subscription<T>
Sourcepub fn request_id(&self) -> Option<i32>
pub fn request_id(&self) -> Option<i32>
Get the request ID associated with this subscription
Source§impl<T: StreamDecoder<T> + Send + 'static> Subscription<T>
impl<T: StreamDecoder<T> + Send + 'static> Subscription<T>
Sourcepub async fn collect_for(&mut self, timeout: Duration) -> Vec<T>
pub async fn collect_for(&mut self, timeout: Duration) -> Vec<T>
Collects data items into a Vec, bounded by a total wall-clock timeout.
Drives the subscription until the first of: the timeout elapses, the
stream ends, a snapshot-end sentinel arrives (e.g.
TickTypes::SnapshotEnd),
or a terminal error occurs. Notices are filtered (logged at warn!); the
snapshot-end sentinel is not included in the returned Vec. On a terminal
error the items collected so far are returned (the error is logged at
warn!). A broadcast lag (SUBSCRIPTION_LAG_CODE)
counts as one: collection stops at the gap, so the rows have no hole.
This is the one-shot snapshot terminal: combined with
MarketDataBuilder::snapshot,
the request returns one round of data ending in a snapshot sentinel, so
timeout acts only as a safety bound. Equivalent to
collect_until with a predicate that never fires.
§Examples
use ibapi::prelude::*;
use std::time::Duration;
#[tokio::main]
async fn main() {
let client = Client::connect("127.0.0.1:4002", 100).await.expect("connection failed");
let contract = Contract::stock("AAPL").build();
let mut subscription = client.market_data(&contract).snapshot().subscribe().await.expect("request failed");
let ticks = subscription.collect_for(Duration::from_secs(5)).await;
println!("collected {} ticks", ticks.len());
}Sourcepub async fn collect_until(
&mut self,
timeout: Duration,
stop: impl FnMut(&[T]) -> bool,
) -> Vec<T>
pub async fn collect_until( &mut self, timeout: Duration, stop: impl FnMut(&[T]) -> bool, ) -> Vec<T>
Collects data items into a Vec, stopping early once stop is satisfied.
Like collect_for, but after each item is appended
the stop predicate is called with the full accumulated slice; returning
true ends collection (the triggering item is included). Use it to stop
as soon as the fields of interest are populated, rather than waiting out
the whole timeout. The same timeout / stream-end / snapshot-end /
terminal-error bounds as collect_for still apply.
§Examples
use ibapi::market_data::realtime::TickTypes;
use ibapi::prelude::*;
use std::time::Duration;
#[tokio::main]
async fn main() {
let client = Client::connect("127.0.0.1:4002", 100).await.expect("connection failed");
let contract = Contract::stock("AAPL").build();
let mut subscription = client.market_data(&contract).snapshot().subscribe().await.expect("request failed");
// Stop as soon as a price tick has arrived.
let ticks = subscription
.collect_until(Duration::from_secs(5), |ticks| {
ticks.iter().any(|t| matches!(t, TickTypes::Price(_) | TickTypes::PriceSize(_)))
})
.await;
println!("collected {} ticks", ticks.len());
}Sourcepub async fn collect_to_end_within(
&mut self,
timeout: Duration,
) -> Result<Vec<T>, Error>
pub async fn collect_to_end_within( &mut self, timeout: Duration, ) -> Result<Vec<T>, Error>
Collects every data item until TWS’s end marker, or fails once timeout
passes.
For requests that end, such as contract details, where a partial result
is not a result. Unlike collect_for, running out
of time is an error, not a shorter Vec:
| Outcome | Result |
|---|---|
| End marker (or snapshot end) | Ok(rows) |
Terminal error, such as a TWS rejection (Error::Notice) | that error |
| Consumer fell behind and frames were dropped | Error::Notice with SUBSCRIPTION_LAG_CODE |
| Stream closed without the end marker | Error::UnexpectedEndOfStream |
timeout passed | Error::Timeout; rows read so far are dropped |
Notices are logged at warn!. A stream with no end marker (market data)
always ends in Timeout; use collect_for for those.
After a timeout the request may still be running at TWS. Dropping the
subscription sends TWS’s cancel, where the request type has one; to
learn whether the request is over before reusing its id, call
cancel_and_drain.
§Examples
use ibapi::prelude::*;
use ibapi::Error;
use std::time::Duration;
#[tokio::main]
async fn main() {
let client = Client::connect("127.0.0.1:4002", 100).await.expect("connection failed");
let contract = Contract::stock("AAPL").build();
let mut subscription = client.contract_details_stream(&contract).subscribe().await.expect("request failed");
match subscription.collect_to_end_within(Duration::from_secs(30)).await {
Ok(details) => println!("{} contracts", details.len()),
Err(Error::Timeout) => eprintln!("no answer in 30s"), // drop sends the cancel
Err(e) => eprintln!("request failed: {e}"),
}
}Sourcepub async fn next_batch(
&mut self,
quiet: Duration,
) -> Option<Result<Vec<T>, Error>>
pub async fn next_batch( &mut self, quiet: Duration, ) -> Option<Result<Vec<T>, Error>>
Returns the next batch of data items: those that arrive together, closed
by quiet without an item or by a batch-end marker.
For streams that send an initial dump ending in an end marker, then push
updates without one: account summary, account updates, positions and
their multi variants. Each push closes once quiet passes without a
row; choose quiet longer than the gap between the rows of one push. A
gap longer than quiet inside the initial dump splits it: the batch
ending in the marker completes it, so check batch.last().
On a stream that never pauses for quiet, such as market data, a batch
never closes.
Waits without a time limit until the first item arrives.
| Outcome | Result |
|---|---|
| Batch-end marker | Some(Ok(rows)), the marker last |
quiet passed after a row | Some(Ok(rows)) |
| Stream ended | Some(Ok(rows)) if any were read, else None |
| Terminal error | Some(Err(_)); rows of the partial batch are dropped |
| Consumer fell behind and frames were dropped | Some(Err(Error::Notice)) with SUBSCRIPTION_LAG_CODE; the stream stays open for the next batch |
Notices are logged at warn!.
Not cancel-safe: dropping the future, as tokio::select! does with
the branches that lose, drops the rows of the partial batch.
§Examples
use ibapi::prelude::*;
use ibapi::accounts::PositionUpdate;
use std::time::Duration;
#[tokio::main]
async fn main() {
let client = Client::connect("127.0.0.1:4002", 100).await.expect("connection failed");
let mut subscription = client.positions().await.expect("request failed");
while let Some(batch) = subscription.next_batch(Duration::from_secs(1)).await {
let batch = batch.expect("positions error");
let initial = matches!(batch.last(), Some(PositionUpdate::PositionEnd));
println!("{} updates (initial dump: {initial})", batch.len());
}
}Sourcepub async fn cancel_and_drain(self, deadline: Instant) -> Result<Drained, Error>
pub async fn cancel_and_drain(self, deadline: Instant) -> Result<Drained, Error>
Cancel the request and wait, up to deadline, for TWS to confirm it
is over, discarding anything that arrives meanwhile.
Use it when the request id must be known finished before it’s reused, or before the next request under strict pacing. Dropping the subscription also cancels, but doesn’t wait for TWS.
| Outcome | Meaning |
|---|---|
Drained::Ended | TWS sent the end marker, before or after the cancel. Nothing is written if it (or a snapshot’s end) had already arrived. |
Drained::Rejected | TWS answered with an error for the request, before or during the drain. |
Drained::Unconfirmed | The deadline passed, or the stream had already ended with an error on our side (such as Error::BufferLimitExceeded). Treat the id as possibly live. |
Err | The connection reset or the client shut down meanwhile. |
The cancel is TWS’s native one, where the request type has one (contract
details: server 215+); otherwise nothing is written and the drain waits
for a natural end. Observed live (server 225), TWS kept sending contract
details after the cancel: the rest of a prepared 714-row result, then
the end marker; and 8,000+ rows over 150 s of an unfiltered option
query with no end marker yet. So the drain usually waits out the whole
result: size deadline for it, and prefer narrow queries. A stream with
no end marker (market data) always ends Unconfirmed. Subscriptions
without a request id (shared, order and order-update streams) are cancelled as by
cancel and return Unconfirmed immediately.
Dropping the returned future mid-drain is safe: the cancel write runs in its own task and completes, the subscription drops, and nothing is written twice.
§Examples
use ibapi::prelude::*;
use tokio::time::{Duration, Instant};
#[tokio::main]
async fn main() {
let client = Client::connect("127.0.0.1:4002", 100).await.expect("connection failed");
let contract = Contract::stock("AAPL").build();
let mut subscription = client.contract_details_stream(&contract).subscribe().await.expect("request failed");
let first = subscription.next().await;
println!("first row: {first:?}");
match subscription.cancel_and_drain(Instant::now() + Duration::from_secs(10)).await {
Ok(Drained::Ended) | Ok(Drained::Rejected(_)) => println!("request finished at TWS"),
Ok(Drained::Unconfirmed) => println!("not confirmed; don't reuse the request slot yet"),
Err(e) => eprintln!("session error: {e}"),
}
}Source§impl<T: StreamDecoder<T>> Subscription<T>
impl<T: StreamDecoder<T>> Subscription<T>
Sourcepub async fn cancel(&self)
pub async fn cancel(&self)
Cancel the subscription.
Writes TWS’s cancel unless the request has already finished (end
marker, snapshot end, or a TWS error its type knows ends the request)
or its type has none. Either way the stream stops, for every clone: the
next poll yields Err(Error::Cancelled), frames not yet read are
skipped, and the stream ends. A clone already waiting in next() is
woken to yield it. Idempotent.
Trait Implementations§
Source§impl<T: StreamDecoder<T>> Clone for Subscription<T>
impl<T: StreamDecoder<T>> Clone for Subscription<T>
Source§impl<T: StreamDecoder<T> + Send + 'static> Stream for Subscription<T>
impl<T: StreamDecoder<T> + Send + 'static> Stream for Subscription<T>
Auto Trait Implementations§
impl<T> !Freeze for Subscription<T>
impl<T> !RefUnwindSafe for Subscription<T>
impl<T> !UnwindSafe for Subscription<T>
impl<T> Send for Subscription<T>
impl<T> Sync for Subscription<T>
impl<T> Unpin for Subscription<T>
impl<T> UnsafeUnpin for Subscription<T>where
Arc<RequestState<T>>: UnsafeUnpin,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> StreamExt for T
impl<T> StreamExt for T
Source§fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
Source§fn into_future(self) -> StreamFuture<Self> ⓘ
fn into_future(self) -> StreamFuture<Self> ⓘ
Source§fn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
Source§fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
Source§fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
Source§fn collect<C>(self) -> Collect<Self, C> ⓘ
fn collect<C>(self) -> Collect<Self, C> ⓘ
Source§fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
Source§fn concat(self) -> Concat<Self> ⓘ
fn concat(self) -> Concat<Self> ⓘ
Source§fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
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 any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
true if any element in stream satisfied a predicate. Read moreSource§fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> ⓘ
fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> ⓘ
true if all element in stream satisfied a predicate. Read moreSource§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Source§fn flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> FlattenUnorderedWithFlowController<Self, ()>
fn flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> FlattenUnorderedWithFlowController<Self, ()>
Source§fn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> FlatMapUnordered<Self, U, F>
fn flat_map_unordered<U, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> FlatMapUnordered<Self, U, F>
StreamExt::map but flattens nested Streams
and polls them concurrently, yielding items in any order, as they made
available. Read moreSource§fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
StreamExt::fold that holds internal state
and produces a new stream. Read moreSource§fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
true. Read moreSource§fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
true. Read moreSource§fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
Source§fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> ⓘ
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> ⓘ
Source§fn for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> ForEachConcurrent<Self, Fut, F> ⓘ
fn for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> ForEachConcurrent<Self, Fut, F> ⓘ
Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n items of the underlying stream. Read moreSource§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n items of the underlying stream. Read moreSource§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Source§fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
Source§fn buffered(self, n: usize) -> Buffered<Self>
fn buffered(self, n: usize) -> Buffered<Self>
Source§fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
Source§fn zip<St>(self, other: St) -> Zip<Self, St>
fn zip<St>(self, other: St) -> Zip<Self, St>
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 ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
Source§fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
Source§fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Source§fn left_stream<B>(self) -> Either<Self, B> ⓘ
fn left_stream<B>(self) -> Either<Self, B> ⓘ
Source§fn right_stream<B>(self) -> Either<B, Self> ⓘ
fn right_stream<B>(self) -> Either<B, Self> ⓘ
Source§fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
Stream::poll_next on Unpin
stream types.Source§fn select_next_some(&mut self) -> SelectNextSome<'_, Self> ⓘwhere
Self: Unpin + FusedStream,
fn select_next_some(&mut self) -> SelectNextSome<'_, Self> ⓘwhere
Self: Unpin + FusedStream,
Source§impl<St> StreamExt for St
impl<St> StreamExt for St
Source§fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
None if the
stream is finished. Read moreSource§fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
Source§fn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
Source§fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
None. Read moreSource§fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
Source§fn merge<U>(self, other: U) -> Merge<Self, U>
fn merge<U>(self, other: U) -> Merge<Self, U>
Source§fn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
Source§fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
Source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
None. Read moreSource§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n items of the underlying stream. Read moreSource§fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
true. Read moreSource§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n first items of the
underlying stream. Read moreSource§fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
true. Read moreSource§fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
Source§fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
Source§fn chain<U>(self, other: U) -> Chain<Self, U>
fn chain<U>(self, other: U) -> Chain<Self, U>
Source§fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
Source§impl<S> SubscriptionItemStreamExt for Swhere
S: Stream,
impl<S> SubscriptionItemStreamExt for Swhere
S: Stream,
Source§fn filter_data<T>(self) -> FilterDataStream<Self>
fn filter_data<T>(self) -> FilterDataStream<Self>
self in a FilterDataStream adapter that drops
SubscriptionItem::Notice items (logging them) and yields the
underlying Result<T, Error>.Source§impl<S> TryStreamExt for S
impl<S> TryStreamExt for S
Source§fn err_into<E>(self) -> ErrInto<Self, E>
fn err_into<E>(self) -> ErrInto<Self, E>
Source§fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
Source§fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
Source§fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
f. Read moreSource§fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
f. Read moreSource§fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
fn inspect_ok<F>(self, f: F) -> InspectOk<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 into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Source§fn try_next(&mut self) -> TryNext<'_, Self> ⓘwhere
Self: Unpin,
fn try_next(&mut self) -> TryNext<'_, Self> ⓘwhere
Self: Unpin,
Source§fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> ⓘ
fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> ⓘ
Source§fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
true. Read moreSource§fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
true. Read moreSource§fn try_for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> TryForEachConcurrent<Self, Fut, F> ⓘ
fn try_for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> TryForEachConcurrent<Self, Fut, F> ⓘ
Source§fn try_collect<C>(self) -> TryCollect<Self, C> ⓘ
fn try_collect<C>(self) -> TryCollect<Self, C> ⓘ
Source§fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
Source§fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
Source§fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
Source§fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
Source§fn try_flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> TryFlattenUnordered<Self>
fn try_flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> TryFlattenUnordered<Self>
Source§fn try_flatten(self) -> TryFlatten<Self>
fn try_flatten(self) -> TryFlatten<Self>
Source§fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> ⓘ
fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> ⓘ
Source§fn try_concat(self) -> TryConcat<Self> ⓘ
fn try_concat(self) -> TryConcat<Self> ⓘ
Source§fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
Source§fn try_buffered(self, n: usize) -> TryBuffered<Self>
fn try_buffered(self, n: usize) -> TryBuffered<Self>
Source§fn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
fn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
TryStream::try_poll_next on Unpin
stream types.Source§fn into_async_read(self) -> IntoAsyncRead<Self>
fn into_async_read(self) -> IntoAsyncRead<Self>
AsyncBufRead. Read moreSource§fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> ⓘ
fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> ⓘ
Err is encountered or if an Ok item is found
that does not satisfy the predicate. Read more