ByteStream

Type Alias ByteStream 

Source
pub type ByteStream = Streaming<Bytes>;
Expand description

A stream of binary data.

§Chunking

Note that bytes sent by the server might not arrive in the same chunking as they were sent. This is because the underlying transport layer (HTTP/2 or HTTP/3) may choose to split or combine chunks for efficiency.

If you need to preserve individual byte boundaries, consider using ChunkedByteStream or another encoding that preserves chunk boundaries.

Aliased Type§

pub struct ByteStream { /* private fields */ }

Trait Implementations§

Source§

impl<S, E> From<S> for ByteStream
where S: Stream<Item = Result<Bytes, E>> + Send + 'static,

Source§

fn from(value: S) -> Self

Converts to this type from the input type.
Source§

impl<S> FromRequest<S> for ByteStream

Source§

type Rejection = ServerFnError

If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response.
Source§

fn from_request( req: Request, _state: &S, ) -> impl Future<Output = Result<Self, Self::Rejection>> + Send

Perform the extraction.
Source§

impl IntoRequest for ByteStream

Source§

fn into_request( self, builder: ClientRequest, ) -> impl Future<Output = Result<ClientResponse, RequestError>> + 'static