pub struct ReadAsFuturesStream<S>{ /* private fields */ }Available on crate feature
futures-stream only.Expand description
Adapts a Read implementation to the futures::Stream API.
Each item in the futures::Stream is a BytesView containing some bytes read
from the underlying Read.
§Security
This adapter is insecure if the side producing the bytes is not trusted. An attacker may trickle data byte-by-byte, consuming a large amount of resources.
Robust code working with untrusted sources should take precautions such as only processing
read data when either a time or length threshold is reached and reusing buffers that
have remaining capacity, appending additional data to existing buffers using
read_more_into() instead of reserving new buffers
for each read operation.
Implementations§
Source§impl<S> ReadAsFuturesStream<S>
impl<S> ReadAsFuturesStream<S>
Sourcepub fn into_inner(self: Pin<Box<Self>>) -> S
pub fn into_inner(self: Pin<Box<Self>>) -> S
Abandons any ongoing read operation and returns the source.
Trait Implementations§
Source§impl<S> Debug for ReadAsFuturesStream<S>
impl<S> Debug for ReadAsFuturesStream<S>
Source§impl<S> Stream for ReadAsFuturesStream<S>
impl<S> Stream for ReadAsFuturesStream<S>
Auto Trait Implementations§
impl<S> Freeze for ReadAsFuturesStream<S>where
S: Freeze,
impl<S> !RefUnwindSafe for ReadAsFuturesStream<S>
impl<S> !Send for ReadAsFuturesStream<S>
impl<S> !Sync for ReadAsFuturesStream<S>
impl<S> !Unpin for ReadAsFuturesStream<S>
impl<S> !UnwindSafe for ReadAsFuturesStream<S>
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
Mutably borrows from an owned value. Read more