pub trait OutgoingBody {
type Error: Into<IntoHttpError>;
// Required methods
fn content_type(&self) -> Option<HeaderValue>;
fn try_into_buf<T: Default + BufMut + AsRef<[u8]>>(
self,
) -> Result<T, Self::Error>;
}Available on crate feature
api only.Expand description
HTTP message body pre-serialization.
Required Associated Types§
Sourcetype Error: Into<IntoHttpError>
type Error: Into<IntoHttpError>
The type of error that can happen in try_info_buf.
Required Methods§
Sourcefn content_type(&self) -> Option<HeaderValue>
fn content_type(&self) -> Option<HeaderValue>
The value for the Content-Type HTTP header for this body, if there is one.
This is the value set if the request or response type does not set one dynamically, for
example with the #[ruma_api(header = CONTENT_TYPE)] attribute.
If this is None, no Content-Type HTTP header is added.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".