pub struct BlobStream {
pub content_type: String,
pub size: u64,
pub body: BoxStream<'static, Result<Bytes, StreamError>>,
}Expand description
A streamed object body (issue #586): what Blob::get_stream returns
instead of buffering the bytes. size and content_type are known
before a single chunk is read, so a handler can set response headers
from them.
Fields§
§content_type: StringThe content type the object was stored with.
size: u64The object’s size in bytes, known up front.
body: BoxStream<'static, Result<Bytes, StreamError>>The body chunks. A chunk error is a mid-stream transport failure.
Implementations§
Source§impl BlobStream
impl BlobStream
Sourcepub fn into_response_stream(self) -> ResponseStream
pub fn into_response_stream(self) -> ResponseStream
Turns the body into a ResponseStream, so a handler on a route
its module declared in
Module::streaming_routes can
return an object without buffering it first (issue #586).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BlobStream
impl !Sync for BlobStream
impl !UnwindSafe for BlobStream
impl Freeze for BlobStream
impl Send for BlobStream
impl Unpin for BlobStream
impl UnsafeUnpin for BlobStream
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