Skip to main content

Module combination

Module combination 

Source
Expand description

How the instances of a field combine, as a type-level marker on each FieldType.

The marker decides how a section may declare the field: a Singleton as Option<T>, or as T when it is required, and a List or Separate field as Vec<T>. Declaring one the wrong way is a compile-time error. The markers are the only combinations: the traits here cannot be implemented outside this crate.

Structs§

List
A field whose instances form one comma-separated list, as RFC 9110 section 5.3 combines them, such as Accept or Cache-Control.
Separate
A field whose instances are separate values that must not be combined, because a value can contain a comma, such as Set-Cookie or an email’s Received.
Singleton
A field that appears at most once, such as Content-Length or Content-Type: a second instance is an error, even with the same value.

Traits§

Combination
One of the combination markers: Singleton, List, or Separate.
MultipleValues
The combinations that collect several values: List and Separate.
SingleValue
The combination of a field that appears at most once: Singleton.