pub struct Bytes<'a>(pub &'a mut TakoBody);Expand description
Raw request body extractor that provides access to the underlying body stream.
This extractor wraps a reference to the raw request body implementing http_body::Body,
allowing direct access to the request body without buffering.
Naming note: this Bytes<'a> is distinct from the very-common
bytes::Bytes type from the bytes crate
(which is a refcounted byte buffer, not a body reference). In handlers
that need both, import this as
use tako::extractors::bytes::Bytes as BytesBody; to avoid the clash.
Tuple Fields§
§0: &'a mut TakoBodyTrait Implementations§
Source§impl<'a> FromRequest<'a> for Bytes<'a>
impl<'a> FromRequest<'a> for Bytes<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Bytes<'a>
impl<'a> !Sync for Bytes<'a>
impl<'a> !UnwindSafe for Bytes<'a>
impl<'a> Freeze for Bytes<'a>
impl<'a> Send for Bytes<'a>
impl<'a> Unpin for Bytes<'a>
impl<'a> UnsafeUnpin for Bytes<'a>
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more