pub struct HeaderData {
pub name: String,
pub value: Option<String>,
pub value_bytes: Vec<u8>,
}Expand description
Represents an individual HTTP header.
This struct contains the name of the header and its value, which can be stored as a string or raw binary data.
§Fields
name– The name of the header (e.g.,"Content-Type").value(optional) – The header value as aStringif it contains text data.value_bytes– The header value in raw binary form.
§Notes
- If the header contains non-textual data,
valuewill beNone, and the raw data should be accessed viavalue_bytes. - If the header contains textual data,
valuewill hold the string representation.
Fields§
§name: String§value: Option<String>§value_bytes: Vec<u8>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HeaderData
impl RefUnwindSafe for HeaderData
impl Send for HeaderData
impl Sync for HeaderData
impl Unpin for HeaderData
impl UnsafeUnpin for HeaderData
impl UnwindSafe for HeaderData
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