pub struct Header {
pub name: String,
pub value: String,
}Expand description
Header is a single HTTP-style name/value metadata pair attached to an
NWEP request or response.
Header names follow the same conventions as HTTP/2 pseudo-headers and
lowercase field names. Pseudo-headers (:method, :path, :status,
:version) must appear before regular headers. See the constants in
crate::protocol for the well-known header name strings.
Both name and value are arbitrary UTF-8 strings. The C library enforces
a maximum byte length of MAX_HEADER_SIZE for each field and a maximum
count of MAX_HEADERS per message.
§Example
use nwep::types::Header;
use nwep::protocol::HDR_TRACE_ID;
let h = Header::new(HDR_TRACE_ID, "deadbeef...");
assert_eq!(h.name, "trace-id");Fields§
§name: Stringname is the header field name (e.g., "content-type", ":method").
value: Stringvalue is the header field value (e.g., "application/octet-stream",
"read").
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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