Type Alias http::header::map::Size

source ·
type Size = u16;
Expand description

Type used for representing the size of a HeaderMap value.

32,768 is more than enough entries for a single header map. Setting this limit enables using u16 to represent all offsets, which takes 2 bytes instead of 8 on 64 bit processors.

Setting this limit is especially beneficial for indices, making it more cache friendly. More hash codes can fit in a cache line.

You may notice that u16 may represent more than 32,768 values. This is true, but 32,768 should be plenty and it allows us to reserve the top bit for future usage.

Trait Implementations§

source§

impl<T> From<Port<T>> for u16

source§

fn from(port: Port<T>) -> Self

Converts to this type from the input type.
source§

impl From<StatusCode> for u16

source§

fn from(status: StatusCode) -> u16

Converts to this type from the input type.
source§

impl<T> PartialEq<Port<T>> for u16

source§

fn eq(&self, other: &Port<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<StatusCode> for u16

source§

fn eq(&self, other: &StatusCode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.