pub struct Message { /* private fields */ }Expand description
An HTTP message, either request or response, including any optional informational responses on a response.
Implementations§
Source§impl Message
impl Message
Sourcepub fn request(
method: Vec<u8>,
scheme: Vec<u8>,
authority: Vec<u8>,
path: Vec<u8>,
) -> Self
pub fn request( method: Vec<u8>, scheme: Vec<u8>, authority: Vec<u8>, path: Vec<u8>, ) -> Self
Construct a minimal request message.
Sourcepub fn response(status: StatusCode) -> Self
pub fn response(status: StatusCode) -> Self
Construct a minimal response message.
Sourcepub fn put_header(
&mut self,
name: impl Into<Vec<u8>>,
value: impl Into<Vec<u8>>,
)
pub fn put_header( &mut self, name: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, )
Set a header field value.
Sourcepub fn put_trailer(
&mut self,
name: impl Into<Vec<u8>>,
value: impl Into<Vec<u8>>,
)
pub fn put_trailer( &mut self, name: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, )
Set a trailer field value.
Sourcepub fn write_content(&mut self, d: impl AsRef<[u8]>)
pub fn write_content(&mut self, d: impl AsRef<[u8]>)
Extend the content of the message with the given bytes.
Sourcepub fn informational(&self) -> &[InformationalResponse]
pub fn informational(&self) -> &[InformationalResponse]
Access informational status responses.
Sourcepub fn control(&self) -> &ControlData
pub fn control(&self) -> &ControlData
Access control data.
Sourcepub fn trailer(&self) -> &FieldSection
pub fn trailer(&self) -> &FieldSection
Get the trailer fields.
Sourcepub fn read_bhttp<T, R>(r: &mut T) -> Result<Self, Error>
pub fn read_bhttp<T, R>(r: &mut T) -> Result<Self, Error>
Read a BHTTP message.
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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