pub struct HttpHeader<'a> {
pub name: &'a str,
pub value: &'a str,
}Expand description
HTTP Header struct for representing a single header with owned strings
This struct represents a single HTTP header with a name and value.
Headers are used to pass additional information about the request or response.
For no_std compatibility, we use heapless::String with fixed capacity.
Fields§
§name: &'a strThe name of the header (e.g., “Content-Type”, “Authorization”)
value: &'a strThe value of the header (e.g., “application/json”, “Bearer token123”)
Implementations§
Source§impl<'a> HttpHeader<'a>
impl<'a> HttpHeader<'a>
Sourcepub const fn content_type(value: &'a str) -> Self
pub const fn content_type(value: &'a str) -> Self
Create a Content-Type header
Create an Authorization header
Sourcepub const fn user_agent(value: &'a str) -> Self
pub const fn user_agent(value: &'a str) -> Self
Create a User-Agent header
Trait Implementations§
Source§impl<'a> Clone for HttpHeader<'a>
impl<'a> Clone for HttpHeader<'a>
Source§fn clone(&self) -> HttpHeader<'a>
fn clone(&self) -> HttpHeader<'a>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<'a> Freeze for HttpHeader<'a>
impl<'a> RefUnwindSafe for HttpHeader<'a>
impl<'a> Send for HttpHeader<'a>
impl<'a> Sync for HttpHeader<'a>
impl<'a> Unpin for HttpHeader<'a>
impl<'a> UnwindSafe for HttpHeader<'a>
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