pub struct StreamObj<'a, T>(_);
A custom trait object for polling streams, roughly akin to
Box<dyn Stream<Item = T> + Send + 'a>
.
This custom trait object was introduced for two reasons:
- Currently it is not possible to take
dyn Trait
by value and
Box<dyn Trait>
is not available in no_std contexts.
- The
Stream
trait is currently not object safe: The Stream::poll_next
method makes uses the arbitrary self types feature and traits in which
this feature is used are currently not object safe due to current compiler
limitations. (See tracking issue for arbitray self types for more
information #44874)
Create a StreamObj
from a custom trait object representation.
type Item = T
Values yielded by the stream.
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
Formats the value using the given formatter. Read more
type Ok = T
The type of successful values yielded by this future
The type of failures yielded by this future
Poll this TryStream
as if it were a Stream
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)