pub enum Binary {
Bytes(Bytes),
Slice(&'static [u8]),
SharedVec(Arc<Vec<u8>>),
// some variants omitted
}
Expand description
Represents various types of binary body.
Content-Length
header is set to length of the body.
Variants
Bytes(Bytes)
Bytes body
Slice(&'static [u8])
Static slice
SharedVec(Arc<Vec<u8>>)
Shared vec body
Implementations
Trait Implementations
sourceimpl Responder for Binary
impl Responder for Binary
type Item = HttpResponse
type Item = HttpResponse
The associated item which can be returned.
sourcefn respond_to<S>(self, req: &HttpRequest<S>) -> Result<HttpResponse, Error>
fn respond_to<S>(self, req: &HttpRequest<S>) -> Result<HttpResponse, Error>
Convert itself to
AsyncResult
or Error
.impl StructuralPartialEq for Binary
Auto Trait Implementations
impl RefUnwindSafe for Binary
impl Send for Binary
impl Sync for Binary
impl Unpin for Binary
impl UnwindSafe for Binary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more