pub struct RequestContent<T, F = JsonFormat> { /* private fields */ }Expand description
The body content of a service client request.
This allows callers to pass a model to serialize or raw content to client methods.
Implementations§
Source§impl<T, F> RequestContent<T, F>
impl<T, F> RequestContent<T, F>
Sourcepub fn from(body: Vec<u8>) -> RequestContent<T, F>
pub fn from(body: Vec<u8>) -> RequestContent<T, F>
Create a new RequestContent from a Vec<u8>.
Allocation may be avoided in some cases.
Sourcepub fn from_slice(body: &[u8]) -> RequestContent<T, F>
pub fn from_slice(body: &[u8]) -> RequestContent<T, F>
Copies bytes into a new RequestContent.
Sourcepub fn from_static(body: &'static [u8]) -> RequestContent<T, F>
pub fn from_static(body: &'static [u8]) -> RequestContent<T, F>
Create a new RequestContent from a static slice.
This should not allocate.
Sourcepub fn from_str(body: &str) -> RequestContent<T, F>
pub fn from_str(body: &str) -> RequestContent<T, F>
Copies UTF-8 bytes into a new RequestContent.
Trait Implementations§
Source§impl<T, F> Clone for RequestContent<T, F>
impl<T, F> Clone for RequestContent<T, F>
Source§fn clone(&self) -> RequestContent<T, F>
fn clone(&self) -> RequestContent<T, F>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, F> Debug for RequestContent<T, F>
impl<T, F> Debug for RequestContent<T, F>
Source§impl<T, F> From<Body> for RequestContent<T, F>
impl<T, F> From<Body> for RequestContent<T, F>
Source§fn from(body: Body) -> RequestContent<T, F>
fn from(body: Body) -> RequestContent<T, F>
Converts to this type from the input type.
Source§impl<T, F> From<Bytes> for RequestContent<T, F>
impl<T, F> From<Bytes> for RequestContent<T, F>
Source§fn from(body: Bytes) -> RequestContent<T, F>
fn from(body: Bytes) -> RequestContent<T, F>
Converts to this type from the input type.
Source§impl<T, F> From<RequestContent<T, F>> for Body
impl<T, F> From<RequestContent<T, F>> for Body
Source§fn from(content: RequestContent<T, F>) -> Body
fn from(content: RequestContent<T, F>) -> Body
Converts to this type from the input type.
Source§impl<T> TryFrom<&str> for RequestContent<T>
impl<T> TryFrom<&str> for RequestContent<T>
Source§impl<T, F> TryFrom<HashMap<String, OffsetDateTime>> for RequestContent<T, F>
impl<T, F> TryFrom<HashMap<String, OffsetDateTime>> for RequestContent<T, F>
Source§fn try_from(
body: HashMap<String, OffsetDateTime>,
) -> Result<RequestContent<T, F>, <RequestContent<T, F> as TryFrom<HashMap<String, OffsetDateTime>>>::Error>
fn try_from( body: HashMap<String, OffsetDateTime>, ) -> Result<RequestContent<T, F>, <RequestContent<T, F> as TryFrom<HashMap<String, OffsetDateTime>>>::Error>
Performs the conversion.
Source§impl<T> TryFrom<String> for RequestContent<T>
impl<T> TryFrom<String> for RequestContent<T>
Source§impl<T> TryFrom<Value> for RequestContent<T>
impl<T> TryFrom<Value> for RequestContent<T>
Source§impl<T, F> TryFrom<Vec<OffsetDateTime>> for RequestContent<T, F>
impl<T, F> TryFrom<Vec<OffsetDateTime>> for RequestContent<T, F>
Source§fn try_from(
body: Vec<OffsetDateTime>,
) -> Result<RequestContent<T, F>, <RequestContent<T, F> as TryFrom<Vec<OffsetDateTime>>>::Error>
fn try_from( body: Vec<OffsetDateTime>, ) -> Result<RequestContent<T, F>, <RequestContent<T, F> as TryFrom<Vec<OffsetDateTime>>>::Error>
Performs the conversion.
Source§impl<T> TryFrom<bool> for RequestContent<T>
impl<T> TryFrom<bool> for RequestContent<T>
Source§impl<T> TryFrom<f32> for RequestContent<T>
impl<T> TryFrom<f32> for RequestContent<T>
Source§impl<T> TryFrom<f64> for RequestContent<T>
impl<T> TryFrom<f64> for RequestContent<T>
Source§impl<T> TryFrom<i32> for RequestContent<T>
impl<T> TryFrom<i32> for RequestContent<T>
Auto Trait Implementations§
impl<T, F = JsonFormat> !Freeze for RequestContent<T, F>
impl<T, F = JsonFormat> !RefUnwindSafe for RequestContent<T, F>
impl<T, F = JsonFormat> !UnwindSafe for RequestContent<T, F>
impl<T, F> Send for RequestContent<T, F>
impl<T, F> Sync for RequestContent<T, F>
impl<T, F> Unpin for RequestContent<T, F>
impl<T, F> UnsafeUnpin for RequestContent<T, F>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more