pub struct ResponseHeaders<'b, const N: usize> {
pub http11: bool,
pub code: u16,
pub reason: Option<&'b str>,
pub headers: Headers<'b, N>,
}Expand description
Response headers including the response line (HTTP version, status code, reason phrase)
Fields§
§http11: boolWhether the response is HTTP/1.1
code: u16The status code
reason: Option<&'b str>The reason phrase, if present
headers: Headers<'b, N>The headers
Implementations§
Source§impl<'b, const N: usize> ResponseHeaders<'b, N>
impl<'b, const N: usize> ResponseHeaders<'b, N>
Sourcepub async fn receive<R>(
&mut self,
buf: &'b mut [u8],
input: R,
exact: bool,
) -> Result<(&'b mut [u8], usize), Error<R::Error>>where
R: Read,
pub async fn receive<R>(
&mut self,
buf: &'b mut [u8],
input: R,
exact: bool,
) -> Result<(&'b mut [u8], usize), Error<R::Error>>where
R: Read,
Parse the headers from the input stream
Sourcepub fn resolve<E>(
&self,
request_connection_type: ConnectionType,
) -> Result<(ConnectionType, BodyType), Error<E>>
pub fn resolve<E>( &self, request_connection_type: ConnectionType, ) -> Result<(ConnectionType, BodyType), Error<E>>
Resolve the connection type and body type from the headers
Sourcepub async fn send<W>(
&self,
request_connection_type: ConnectionType,
chunked_if_unspecified: bool,
output: W,
) -> Result<(ConnectionType, BodyType), Error<W::Error>>where
W: Write,
pub async fn send<W>(
&self,
request_connection_type: ConnectionType,
chunked_if_unspecified: bool,
output: W,
) -> Result<(ConnectionType, BodyType), Error<W::Error>>where
W: Write,
Send the headers to the output stream, returning the connection type and body type
Source§impl<const N: usize> ResponseHeaders<'_, N>
impl<const N: usize> ResponseHeaders<'_, N>
Trait Implementations§
Source§impl<'b, const N: usize> Debug for ResponseHeaders<'b, N>
impl<'b, const N: usize> Debug for ResponseHeaders<'b, N>
Source§impl<const N: usize> Default for ResponseHeaders<'_, N>
impl<const N: usize> Default for ResponseHeaders<'_, N>
Auto Trait Implementations§
impl<'b, const N: usize> Freeze for ResponseHeaders<'b, N>
impl<'b, const N: usize> RefUnwindSafe for ResponseHeaders<'b, N>
impl<'b, const N: usize> Send for ResponseHeaders<'b, N>
impl<'b, const N: usize> Sync for ResponseHeaders<'b, N>
impl<'b, const N: usize> Unpin for ResponseHeaders<'b, N>
impl<'b, const N: usize> UnwindSafe for ResponseHeaders<'b, N>
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