Struct http_tiny::HeaderStartLine
source · pub struct HeaderStartLine { /* private fields */ }Expand description
The start line
Implementations§
source§impl HeaderStartLine
impl HeaderStartLine
sourcepub fn new_request<T, U>(method: T, target: U) -> Self
pub fn new_request<T, U>(method: T, target: U) -> Self
Creates a new HTTP/1.1 request
sourcepub fn new_response<T, U>(status: T, reason: U) -> Self
pub fn new_response<T, U>(status: T, reason: U) -> Self
Creates a new HTTP/1.1 response
sourcepub fn read<T>(source: &mut T) -> Result<Self, Error>where
T: BufRead,
pub fn read<T>(source: &mut T) -> Result<Self, Error>where
T: BufRead,
Reads the start line from source
sourcepub fn write_all(&self, output: &mut dyn Write) -> Result<(), Error>
pub fn write_all(&self, output: &mut dyn Write) -> Result<(), Error>
Writes the HTTP start line
sourcepub fn field0(&self) -> &[u8] ⓘ
pub fn field0(&self) -> &[u8] ⓘ
The first field of the header line (i.e. either “method” for requests or “version” for response)
sourcepub fn field0_mut(&mut self) -> &mut Cow<'static, [u8]>
pub fn field0_mut(&mut self) -> &mut Cow<'static, [u8]>
The first field of the header line (i.e. either “method” for requests or “version” for response)
sourcepub fn field1(&self) -> &[u8] ⓘ
pub fn field1(&self) -> &[u8] ⓘ
The second field of the header line (i.e. either “target” for requests or “status” for response)
sourcepub fn field1_mut(&mut self) -> &mut Cow<'static, [u8]>
pub fn field1_mut(&mut self) -> &mut Cow<'static, [u8]>
The second field of the header line (i.e. either “target” for requests or “status” for response)
sourcepub fn field2(&self) -> &[u8] ⓘ
pub fn field2(&self) -> &[u8] ⓘ
The third field of the header line (i.e. either “version” for requests or “reason” for response)
sourcepub fn field2_mut(&mut self) -> &mut Cow<'static, [u8]>
pub fn field2_mut(&mut self) -> &mut Cow<'static, [u8]>
The third field of the header line (i.e. either “version” for requests or “reason” for response)
Trait Implementations§
source§impl Clone for HeaderStartLine
impl Clone for HeaderStartLine
source§fn clone(&self) -> HeaderStartLine
fn clone(&self) -> HeaderStartLine
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for HeaderStartLine
impl Debug for HeaderStartLine
source§impl Ord for HeaderStartLine
impl Ord for HeaderStartLine
source§fn cmp(&self, other: &HeaderStartLine) -> Ordering
fn cmp(&self, other: &HeaderStartLine) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for HeaderStartLine
impl PartialEq for HeaderStartLine
source§fn eq(&self, other: &HeaderStartLine) -> bool
fn eq(&self, other: &HeaderStartLine) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for HeaderStartLine
impl PartialOrd for HeaderStartLine
source§fn partial_cmp(&self, other: &HeaderStartLine) -> Option<Ordering>
fn partial_cmp(&self, other: &HeaderStartLine) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for HeaderStartLine
impl StructuralEq for HeaderStartLine
impl StructuralPartialEq for HeaderStartLine
Auto Trait Implementations§
impl RefUnwindSafe for HeaderStartLine
impl Send for HeaderStartLine
impl Sync for HeaderStartLine
impl Unpin for HeaderStartLine
impl UnwindSafe for HeaderStartLine
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