[−][src]Trait async_std::stream::FromStream
This is supported on
unstable
only.Conversion from a Stream
.
By implementing FromStream
for a type, you define how it will be created from a stream.
This is common for types which describe a collection of some kind.
See also: IntoStream
.
Required methods
ⓘImportant traits for Pin<P>fn from_stream<'a, S: IntoStream<Item = T> + 'a>(
stream: S
) -> Pin<Box<dyn Future<Output = Self> + 'a>>
ⓘImportant traits for Pin<P>
stream: S
) -> Pin<Box<dyn Future<Output = Self> + 'a>>
This is supported on
unstable
only.Creates a value from a stream.
Examples
Basic usage:
// use async_std::stream::FromStream; // let _five_fives = async_std::stream::repeat(5).take(5);
Implementations on Foreign Types
impl<T> FromStream<T> for Vec<T>
[src]
ⓘImportant traits for Pin<P>fn from_stream<'a, S: IntoStream<Item = T>>(
stream: S
) -> Pin<Box<dyn Future<Output = Self> + 'a>> where
<S as IntoStream>::IntoStream: 'a,
[src]
ⓘImportant traits for Pin<P>
stream: S
) -> Pin<Box<dyn Future<Output = Self> + 'a>> where
<S as IntoStream>::IntoStream: 'a,
impl<T, E, V> FromStream<Result<T, E>> for Result<V, E> where
V: FromStream<T>,
[src]
V: FromStream<T>,
ⓘImportant traits for Pin<P>fn from_stream<'a, S: IntoStream<Item = Result<T, E>>>(
stream: S
) -> Pin<Box<dyn Future<Output = Self> + 'a>> where
<S as IntoStream>::IntoStream: 'a,
[src]
ⓘImportant traits for Pin<P>
stream: S
) -> Pin<Box<dyn Future<Output = Self> + 'a>> where
<S as IntoStream>::IntoStream: 'a,
This is supported on
unstable
only.Takes each element in the stream: if it is an Err
, no further
elements are taken, and the Err
is returned. Should no Err
occur, a container with the values of each Result
is returned.