Skip to main content

HeaderValue

Trait HeaderValue 

Source
pub trait HeaderValue:
    Send
    + Sync
    + 'static {
    // Required methods
    fn header_name(&self) -> &'static str;
    fn to_bytes(&self) -> Option<Vec<u8>>;
    fn as_any(&self) -> &dyn Any;
}
Expand description

A header value that can be stored in the Headers map. Locally: stored by TypeId for type-safe access. Remotely: serialized via to_bytes() with header_name() as key.

Required Methods§

Source

fn header_name(&self) -> &'static str

Stable, unique name for wire transport.

Source

fn to_bytes(&self) -> Option<Vec<u8>>

Serialize for remote transport. None = local-only header.

Source

fn as_any(&self) -> &dyn Any

Downcast support.

Implementors§