Struct sc_peerset::Peerset
source · pub struct Peerset { /* private fields */ }
Expand description
Side of the peer set manager owned by the network. In other words, the “receiving” side.
Implements the Stream
trait and can be polled for messages. The Stream
never ends and never
errors.
Implementations§
source§impl Peerset
impl Peerset
sourcepub fn from_config(config: PeersetConfig) -> (Self, PeersetHandle)
pub fn from_config(config: PeersetConfig) -> (Self, PeersetHandle)
Builds a new peerset from the given configuration.
sourcepub fn reserved_peers(&self, set_id: SetId) -> impl Iterator<Item = &PeerId>
pub fn reserved_peers(&self, set_id: SetId) -> impl Iterator<Item = &PeerId>
Returns the list of reserved peers.
sourcepub fn add_to_peers_set(&mut self, set_id: SetId, peer_id: PeerId)
pub fn add_to_peers_set(&mut self, set_id: SetId, peer_id: PeerId)
Adds a node to the given set. The peerset will, if possible and not already the case, try to connect to it.
Note: This has the same effect as
PeersetHandle::add_to_peers_set
.
sourcepub fn incoming(&mut self, set_id: SetId, peer_id: PeerId, index: IncomingIndex)
pub fn incoming(&mut self, set_id: SetId, peer_id: PeerId, index: IncomingIndex)
Indicate that we received an incoming connection. Must be answered either with
a corresponding Accept
or Reject
, except if we were already connected to this peer.
Note that this mechanism is orthogonal to Connect
/Drop
. Accepting an incoming
connection implicitly means Connect
, but incoming connections aren’t cancelled by
dropped
.
sourcepub fn dropped(&mut self, set_id: SetId, peer_id: PeerId, reason: DropReason)
pub fn dropped(&mut self, set_id: SetId, peer_id: PeerId, reason: DropReason)
Indicate that we dropped an active connection with a peer, or that we failed to connect.
Must only be called after the PSM has either generated a Connect
message with this
PeerId
, or accepted an incoming connection with this PeerId
.
sourcepub fn report_peer(&mut self, peer_id: PeerId, score_diff: ReputationChange)
pub fn report_peer(&mut self, peer_id: PeerId, score_diff: ReputationChange)
Reports an adjustment to the reputation of the given peer.
sourcepub fn debug_info(&mut self) -> Value
pub fn debug_info(&mut self) -> Value
Produces a JSON object containing the state of the peerset manager, for debugging purposes.
sourcepub fn num_discovered_peers(&self) -> usize
pub fn num_discovered_peers(&self) -> usize
Returns the number of peers that we have discovered.
Trait Implementations§
source§impl Stream for Peerset
impl Stream for Peerset
Auto Trait Implementations§
impl !RefUnwindSafe for Peerset
impl Send for Peerset
impl Sync for Peerset
impl Unpin for Peerset
impl !UnwindSafe for Peerset
Blanket Implementations§
source§impl<I> IntoStream for Iwhere
I: Stream,
impl<I> IntoStream for Iwhere
I: Stream,
§type IntoStream = I
type IntoStream = I
source§fn into_stream(self) -> I
fn into_stream(self) -> I
source§impl<T> StreamExt for Twhere
T: Stream + ?Sized,
impl<T> StreamExt for Twhere
T: Stream + ?Sized,
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>where
Self: Sized + Unpin,
fn into_future(self) -> StreamFuture<Self>where
Self: Sized + Unpin,
source§fn map<T, F>(self, f: F) -> Map<Self, F>where
F: FnMut(Self::Item) -> T,
Self: Sized,
fn map<T, F>(self, f: F) -> Map<Self, F>where
F: FnMut(Self::Item) -> T,
Self: Sized,
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>where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
source§fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = Option<T>>,
Self: Sized,
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = Option<T>>,
Self: Sized,
source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future,
Self: Sized,
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future,
Self: Sized,
source§fn collect<C>(self) -> Collect<Self, C>where
C: Default + Extend<Self::Item>,
Self: Sized,
fn collect<C>(self) -> Collect<Self, C>where
C: Default + Extend<Self::Item>,
Self: Sized,
source§fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB>where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Sized + Stream<Item = (A, B)>,
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB>where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Sized + Stream<Item = (A, B)>,
source§fn concat(self) -> Concat<Self>where
Self: Sized,
Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,
fn concat(self) -> Concat<Self>where
Self: Sized,
Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,
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>where
F: FnMut(T, Self::Item) -> Fut,
Fut: Future<Output = T>,
Self: Sized,
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>,
Self: Sized,
source§fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
true
if any element in stream satisfied a predicate. Read moresource§fn all<Fut, F>(self, f: F) -> All<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
fn all<Fut, F>(self, f: F) -> All<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
true
if all element in stream satisfied a predicate. Read moresource§fn flatten(self) -> Flatten<Self>where
Self::Item: Stream,
Self: Sized,
fn flatten(self) -> Flatten<Self>where
Self::Item: Stream,
Self: Sized,
source§fn flatten_unordered(
self,
limit: impl Into<Option<usize>>
) -> FlattenUnordered<Self>where
Self::Item: Stream + Unpin,
Self: Sized,
fn flatten_unordered(
self,
limit: impl Into<Option<usize>>
) -> FlattenUnordered<Self>where
Self::Item: Stream + Unpin,
Self: Sized,
source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where
F: FnMut(Self::Item) -> U,
U: Stream,
Self: Sized,
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where
F: FnMut(Self::Item) -> U,
U: Stream,
Self: Sized,
source§fn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F
) -> FlatMapUnordered<Self, U, F>where
U: Stream + Unpin,
F: FnMut(Self::Item) -> U,
Self: Sized,
fn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F
) -> FlatMapUnordered<Self, U, F>where
U: Stream + Unpin,
F: FnMut(Self::Item) -> U,
Self: Sized,
StreamExt::map
but flattens nested Stream
s
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>where
F: FnMut(&mut S, Self::Item) -> Fut,
Fut: Future<Output = Option<B>>,
Self: Sized,
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>>,
Self: Sized,
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>where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
true
. Read moresource§fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>where
F: FnMut(&Self::Item) -> Fut,
Fut: Future<Output = bool>,
Self: Sized,
true
. Read moresource§fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>where
Fut: Future,
Self: Sized,
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>where
Fut: Future,
Self: Sized,
source§fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = ()>,
Self: Sized,
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F>where
F: FnMut(Self::Item) -> Fut,
Fut: Future<Output = ()>,
Self: Sized,
source§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: Sized,
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: Sized,
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, Global>>where
Self: 'a + Sized + Send,
fn boxed<'a>(
self
) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a, Global>>where
Self: 'a + Sized + Send,
source§fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a, Global>>where
Self: 'a + Sized,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a, Global>>where
Self: 'a + Sized,
source§fn buffered(self, n: usize) -> Buffered<Self>where
Self::Item: Future,
Self: Sized,
fn buffered(self, n: usize) -> Buffered<Self>where
Self::Item: Future,
Self: Sized,
source§fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>where
Self::Item: Future,
Self: Sized,
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>where
Self::Item: Future,
Self: Sized,
source§fn zip<St>(self, other: St) -> Zip<Self, St>where
St: Stream,
Self: Sized,
fn zip<St>(self, other: St) -> Zip<Self, St>where
St: Stream,
Self: Sized,
source§fn chain<St>(self, other: St) -> Chain<Self, St>where
St: Stream<Item = Self::Item>,
Self: Sized,
fn chain<St>(self, other: St) -> Chain<Self, St>where
St: Stream<Item = Self::Item>,
Self: Sized,
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>where
S: Sink<Self::Ok, Error = Self::Error>,
Self: TryStream + Sized,
fn forward<S>(self, sink: S) -> Forward<Self, S>where
S: Sink<Self::Ok, Error = Self::Error>,
Self: TryStream + Sized,
source§fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)where
Self: Sink<Item> + Sized,
fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)where
Self: Sink<Item> + Sized,
source§fn inspect<F>(self, f: F) -> Inspect<Self, F>where
F: FnMut(&Self::Item),
Self: Sized,
fn inspect<F>(self, f: F) -> Inspect<Self, F>where
F: FnMut(&Self::Item),
Self: Sized,
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,
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<T> StreamExt for Twhere
T: Stream + ?Sized,
impl<T> StreamExt for Twhere
T: Stream + ?Sized,
source§fn next(&mut self) -> NextFuture<'_, Self>where
Self: Unpin,
fn next(&mut self) -> NextFuture<'_, Self>where
Self: Unpin,
source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n
elements. Read moresource§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
source§fn throttle(self, d: Duration) -> Throttle<Self>where
Self: Sized,
fn throttle(self, d: Duration) -> Throttle<Self>where
Self: Sized,
source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
step
th element. Read moresource§fn chain<U>(self, other: U) -> Chain<Self, U>where
Self: Sized,
U: Stream<Item = Self::Item>,
fn chain<U>(self, other: U) -> Chain<Self, U>where
Self: Sized,
U: Stream<Item = Self::Item>,
source§fn cloned<'a, T>(self) -> Cloned<Self>where
Self: Sized + Stream<Item = &'a T>,
T: 'a + Clone,
fn cloned<'a, T>(self) -> Cloned<Self>where
Self: Sized + Stream<Item = &'a T>,
T: 'a + Clone,
source§fn copied<'a, T>(self) -> Copied<Self>where
Self: Sized + Stream<Item = &'a T>,
T: 'a + Copy,
fn copied<'a, T>(self) -> Copied<Self>where
Self: Sized + Stream<Item = &'a T>,
T: 'a + Copy,
source§fn cycle(self) -> Cycle<Self>where
Self: Clone + Sized,
fn cycle(self) -> Cycle<Self>where
Self: Clone + Sized,
source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
source§fn delay(self, dur: Duration) -> Delay<Self>where
Self: Sized,
fn delay(self, dur: Duration) -> Delay<Self>where
Self: Sized,
source§fn map<B, F>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> B,
fn map<B, F>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> B,
source§fn inspect<F>(self, f: F) -> Inspect<Self, F>where
Self: Sized,
F: FnMut(&Self::Item),
fn inspect<F>(self, f: F) -> Inspect<Self, F>where
Self: Sized,
F: FnMut(&Self::Item),
source§fn last(self) -> LastFuture<Self, Self::Item>where
Self: Sized,
fn last(self) -> LastFuture<Self, Self::Item>where
Self: Sized,
source§fn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
None
. Read moresource§fn filter<P>(self, predicate: P) -> Filter<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn filter<P>(self, predicate: P) -> Filter<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where
Self: Sized,
U: IntoStream,
F: FnMut(Self::Item) -> U,
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where
Self: Sized,
U: IntoStream,
F: FnMut(Self::Item) -> U,
source§fn flatten(self) -> Flatten<Self>where
Self: Sized,
Self::Item: IntoStream,
fn flatten(self) -> Flatten<Self>where
Self: Sized,
Self::Item: IntoStream,
source§fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
source§fn min_by_key<B, F>(self, key_by: F) -> MinByKeyFuture<Self, Self::Item, F>where
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
fn min_by_key<B, F>(self, key_by: F) -> MinByKeyFuture<Self, Self::Item, F>where
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
None
is returned. Read moresource§fn max_by_key<B, F>(self, key_by: F) -> MaxByKeyFuture<Self, Self::Item, F>where
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
fn max_by_key<B, F>(self, key_by: F) -> MaxByKeyFuture<Self, Self::Item, F>where
Self: Sized,
B: Ord,
F: FnMut(&Self::Item) -> B,
None
is returned. Read moresource§fn min_by<F>(self, compare: F) -> MinByFuture<Self, F, Self::Item>where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
fn min_by<F>(self, compare: F) -> MinByFuture<Self, F, Self::Item>where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
None
is returned. Read moresource§fn max(self) -> MaxFuture<Self, Self::Item>where
Self: Sized,
Self::Item: Ord,
fn max(self) -> MaxFuture<Self, Self::Item>where
Self: Sized,
Self::Item: Ord,
None
is returned. Read moresource§fn min(self) -> MinFuture<Self, Self::Item>where
Self: Sized,
Self::Item: Ord,
fn min(self) -> MinFuture<Self, Self::Item>where
Self: Sized,
Self::Item: Ord,
None
is returned. Read moresource§fn max_by<F>(self, compare: F) -> MaxByFuture<Self, F, Self::Item>where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
fn max_by<F>(self, compare: F) -> MaxByFuture<Self, F, Self::Item>where
Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering,
None
is returned. Read moresource§fn nth(&mut self, n: usize) -> NthFuture<'_, Self>where
Self: Unpin + Sized,
fn nth(&mut self, n: usize) -> NthFuture<'_, Self>where
Self: Unpin + Sized,
source§fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F, Self::Item>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F, Self::Item>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
source§fn find<P>(&mut self, p: P) -> FindFuture<'_, Self, P>where
Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool,
fn find<P>(&mut self, p: P) -> FindFuture<'_, Self, P>where
Self: Unpin + Sized,
P: FnMut(&Self::Item) -> bool,
source§fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Option<B>,
fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Option<B>,
source§fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, F, B>where
Self: Sized,
F: FnMut(B, Self::Item) -> B,
fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, F, B>where
Self: Sized,
F: FnMut(B, Self::Item) -> B,
source§fn partition<B, F>(self, f: F) -> PartitionFuture<Self, F, B>where
Self: Sized,
F: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
fn partition<B, F>(self, f: F) -> PartitionFuture<Self, F, B>where
Self: Sized,
F: FnMut(&Self::Item) -> bool,
B: Default + Extend<Self::Item>,
source§fn for_each<F>(self, f: F) -> ForEachFuture<Self, F>where
Self: Sized,
F: FnMut(Self::Item),
fn for_each<F>(self, f: F) -> ForEachFuture<Self, F>where
Self: Sized,
F: FnMut(Self::Item),
source§fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F, Self::Item>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F, Self::Item>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> bool,
source§fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
source§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
skip
s elements based on a predicate. Read moresource§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n
elements. Read moresource§fn timeout(self, dur: Duration) -> Timeout<Self>where
Self: Stream + Sized,
fn timeout(self, dur: Duration) -> Timeout<Self>where
Self: Stream + Sized,
source§fn try_fold<B, F, T, E>(&mut self, init: T, f: F) -> TryFoldFuture<'_, Self, F, T>where
Self: Unpin + Sized,
F: FnMut(B, Self::Item) -> Result<T, E>,
fn try_fold<B, F, T, E>(&mut self, init: T, f: F) -> TryFoldFuture<'_, Self, F, T>where
Self: Unpin + Sized,
F: FnMut(B, Self::Item) -> Result<T, E>,
source§fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Result<(), E>,
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F>where
Self: Unpin + Sized,
F: FnMut(Self::Item) -> Result<(), E>,
source§fn zip<U>(self, other: U) -> Zip<Self, U>where
Self: Sized,
U: Stream,
fn zip<U>(self, other: U) -> Zip<Self, U>where
Self: Sized,
U: Stream,
source§fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB>where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)> + Sized,
fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB>where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)> + Sized,
source§fn collect<'a, B>(self) -> Pin<Box<dyn Future<Output = B> + Send + 'a, Global>>where
Self: 'a + Sized + Send,
B: FromStream<Self::Item>,
Self::Item: Send,
fn collect<'a, B>(self) -> Pin<Box<dyn Future<Output = B> + Send + 'a, Global>>where
Self: 'a + Sized + Send,
B: FromStream<Self::Item>,
Self::Item: Send,
source§fn merge<U>(self, other: U) -> Merge<Self, U>where
Self: Sized,
U: Stream<Item = Self::Item>,
fn merge<U>(self, other: U) -> Merge<Self, U>where
Self: Sized,
U: Stream<Item = Self::Item>,
source§fn partial_cmp<S>(self, other: S) -> PartialCmpFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn partial_cmp<S>(self, other: S) -> PartialCmpFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
Stream
with those
of another. Read moresource§fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>where
Self: Unpin + Sized,
P: FnMut(Self::Item) -> bool,
fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>where
Self: Unpin + Sized,
P: FnMut(Self::Item) -> bool,
source§fn cmp<S>(self, other: S) -> CmpFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: Ord,
fn cmp<S>(self, other: S) -> CmpFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: Ord,
Stream
with those
of another using ‘Ord’. Read moresource§fn count(self) -> CountFuture<Self>where
Self: Sized,
fn count(self) -> CountFuture<Self>where
Self: Sized,
source§fn ne<S>(self, other: S) -> NeFuture<Self, S>where
Self: Sized,
S: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
fn ne<S>(self, other: S) -> NeFuture<Self, S>where
Self: Sized,
S: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
Stream
are lexicographically
not equal to those of another. Read moresource§fn ge<S>(self, other: S) -> GeFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn ge<S>(self, other: S) -> GeFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
Stream
are lexicographically
greater than or equal to those of another. Read moresource§fn eq<S>(self, other: S) -> EqFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
fn eq<S>(self, other: S) -> EqFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialEq<<S as Stream>::Item>,
Stream
are lexicographically
equal to those of another. Read moresource§fn gt<S>(self, other: S) -> GtFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn gt<S>(self, other: S) -> GtFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
Stream
are lexicographically
greater than those of another. Read moresource§fn le<S>(self, other: S) -> LeFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn le<S>(self, other: S) -> LeFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
Stream
are lexicographically
less or equal to those of another. Read moresource§fn lt<S>(self, other: S) -> LtFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
fn lt<S>(self, other: S) -> LtFuture<Self, S>where
Self: Sized + Stream,
S: Stream,
Self::Item: PartialOrd<<S as Stream>::Item>,
Stream
are lexicographically
less than those of another. Read moresource§impl<S> StreamExt for Swhere
S: Stream + ?Sized,
impl<S> StreamExt for Swhere
S: Stream + ?Sized,
source§fn next(&mut self) -> NextFuture<'_, Self>where
Self: Unpin,
fn next(&mut self) -> NextFuture<'_, Self>where
Self: Unpin,
source§fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self>where
Self: Stream<Item = Result<T, E>> + Unpin,
fn try_next<T, E>(&mut self) -> TryNextFuture<'_, Self>where
Self: Stream<Item = Result<T, E>> + Unpin,
source§fn count(self) -> CountFuture<Self>where
Self: Sized,
fn count(self) -> CountFuture<Self>where
Self: Sized,
source§fn map<T, F>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> T,
fn map<T, F>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> T,
source§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where
Self: Sized,
U: Stream,
F: FnMut(Self::Item) -> U,
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>where
Self: Sized,
U: Stream,
F: FnMut(Self::Item) -> U,
source§fn flatten(self) -> Flatten<Self>where
Self: Sized,
Self::Item: Stream,
fn flatten(self) -> Flatten<Self>where
Self: Sized,
Self::Item: Stream,
source§fn then<F, Fut>(self, f: F) -> Then<Self, F, Fut>where
Self: Sized,
F: FnMut(Self::Item) -> Fut,
Fut: Future,
fn then<F, Fut>(self, f: F) -> Then<Self, F, Fut>where
Self: Sized,
F: FnMut(Self::Item) -> Fut,
Fut: Future,
source§fn filter<P>(self, predicate: P) -> Filter<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn filter<P>(self, predicate: P) -> Filter<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
source§fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> Option<T>,
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>where
Self: Sized,
F: FnMut(Self::Item) -> Option<T>,
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 stream. Read moresource§fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
source§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n
items of the stream. Read moresource§fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>where
Self: Sized,
P: FnMut(&Self::Item) -> bool,
source§fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self>where
Self: Sized,
step
th item. Read moresource§fn chain<U>(self, other: U) -> Chain<Self, U>where
Self: Sized,
U: Stream<Item = Self::Item>,
fn chain<U>(self, other: U) -> Chain<Self, U>where
Self: Sized,
U: Stream<Item = Self::Item>,
source§fn cloned<'a, T>(self) -> Cloned<Self>where
Self: Stream<Item = &'a T> + Sized,
T: 'a + Clone,
fn cloned<'a, T>(self) -> Cloned<Self>where
Self: Stream<Item = &'a T> + Sized,
T: 'a + Clone,
source§fn copied<'a, T>(self) -> Copied<Self>where
Self: Stream<Item = &'a T> + Sized,
T: 'a + Copy,
fn copied<'a, T>(self) -> Copied<Self>where
Self: Stream<Item = &'a T> + Sized,
T: 'a + Copy,
source§fn collect<C>(self) -> CollectFuture<Self, C>where
Self: Sized,
C: Default + Extend<Self::Item>,
fn collect<C>(self) -> CollectFuture<Self, C>where
Self: Sized,
C: Default + Extend<Self::Item>,
source§fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C>where
Self: Stream<Item = Result<T, E>> + Sized,
C: Default + Extend<T>,
fn try_collect<T, E, C>(self) -> TryCollectFuture<Self, C>where
Self: Stream<Item = Result<T, E>> + Sized,
C: Default + Extend<T>,
source§fn partition<B, P>(self, predicate: P) -> PartitionFuture<Self, P, B>where
Self: Sized,
B: Default + Extend<Self::Item>,
P: FnMut(&Self::Item) -> bool,
fn partition<B, P>(self, predicate: P) -> PartitionFuture<Self, P, B>where
Self: Sized,
B: Default + Extend<Self::Item>,
P: FnMut(&Self::Item) -> bool,
predicate
is true
and those for which it is
false
, and then collects them into two collections. Read moresource§fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T>where
Self: Sized,
F: FnMut(T, Self::Item) -> T,
fn fold<T, F>(self, init: T, f: F) -> FoldFuture<Self, F, T>where
Self: Sized,
F: FnMut(T, Self::Item) -> T,
source§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 + Sized,
F: FnMut(B, T) -> Result<B, E>,
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 + Sized,
F: FnMut(B, T) -> Result<B, E>,
source§fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>where
Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B>,
source§fn cycle(self) -> Cycle<Self>where
Self: Clone + Sized,
fn cycle(self) -> Cycle<Self>where
Self: Clone + Sized,
source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
(index, item)
. Read moresource§fn inspect<F>(self, f: F) -> Inspect<Self, F>where
Self: Sized,
F: FnMut(&Self::Item),
fn inspect<F>(self, f: F) -> Inspect<Self, F>where
Self: Sized,
F: FnMut(&Self::Item),
source§fn nth(&mut self, n: usize) -> NthFuture<'_, Self>where
Self: Unpin,
fn nth(&mut self, n: usize) -> NthFuture<'_, Self>where
Self: Unpin,
n
th item of the stream. Read moresource§fn last(self) -> LastFuture<Self>where
Self: Sized,
fn last(self) -> LastFuture<Self>where
Self: Sized,
source§fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
fn find<P>(&mut self, predicate: P) -> FindFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(&Self::Item) -> bool,
source§fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F>where
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
fn find_map<F, B>(&mut self, f: F) -> FindMapFuture<'_, Self, F>where
Self: Unpin,
F: FnMut(Self::Item) -> Option<B>,
source§fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
fn position<P>(&mut self, predicate: P) -> PositionFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
source§fn all<P>(&mut self, predicate: P) -> AllFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
fn all<P>(&mut self, predicate: P) -> AllFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
source§fn any<P>(&mut self, predicate: P) -> AnyFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
fn any<P>(&mut self, predicate: P) -> AnyFuture<'_, Self, P>where
Self: Unpin,
P: FnMut(Self::Item) -> bool,
source§fn for_each<F>(self, f: F) -> ForEachFuture<Self, F>where
Self: Sized,
F: FnMut(Self::Item),
fn for_each<F>(self, f: F) -> ForEachFuture<Self, F>where
Self: Sized,
F: FnMut(Self::Item),
source§fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F>where
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
fn try_for_each<F, E>(&mut self, f: F) -> TryForEachFuture<'_, Self, F>where
Self: Unpin,
F: FnMut(Self::Item) -> Result<(), E>,
source§fn zip<U>(self, other: U) -> Zip<Self, U>where
Self: Sized,
U: Stream,
fn zip<U>(self, other: U) -> Zip<Self, U>where
Self: Sized,
U: Stream,
source§fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB>where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)> + Sized,
fn unzip<A, B, FromA, FromB>(self) -> UnzipFuture<Self, FromA, FromB>where
FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Stream<Item = (A, B)> + Sized,
source§fn race<S>(self, other: S) -> Race<Self, S>where
Self: Sized,
S: Stream<Item = Self::Item>,
fn race<S>(self, other: S) -> Race<Self, S>where
Self: Sized,
S: Stream<Item = Self::Item>,
other
stream, with no preference for either stream when both are ready. Read more