date.rs |
|
1533 |
decimal.rs |
|
4734 |
error.rs |
|
7553 |
integer.rs |
|
3930 |
key.rs |
|
5931 |
lib.rs |
!
`sfv` is an implementation of *Structured Field Values for HTTP*, as specified in [RFC 9651](https://httpwg.org/specs/rfc9651.html) for parsing and serializing HTTP field values.
It also exposes a set of types that might be useful for defining new structured fields.
# Data Structures
There are three types of structured fields:
- `Item` -- an `Integer`, `Decimal`, `String`, `Token`, `Byte Sequence`, `Boolean`, `Date`, or `Display String`. It can have associated `Parameters`.
- `List` -- an array of zero or more members, each of which can be an `Item` or an `InnerList`, both of which can have `Parameters`.
- `Dictionary` -- an ordered map of name-value pairs, where the names are short textual strings and the values are `Item`s or arrays of `Items` (represented with `InnerList`), both of which can have associated parameters. There can be zero or more members, and their names are unique in the scope of the `Dictionary` they occur within.
There are also a few lower-level types used to construct structured field values:
- `BareItem` is used as `Item`'s value or as a parameter value in `Parameters`.
- `Parameters` are an ordered map of key-value pairs that are associated with an `Item` or `InnerList`. The keys are unique within the scope the `Parameters` they occur within, and the values are `BareItem`.
- `InnerList` is an array of zero or more `Items`. Can have associated `Parameters`.
- `ListEntry` represents either `Item` or `InnerList` as a member of `List` or as member-value in `Dictionary`.
# Examples
|
20179 |
parsed.rs |
|
9713 |
parser.rs |
|
21885 |
ref_serializer.rs |
|
13659 |
serializer.rs |
|
3895 |
string.rs |
|
5726 |
test_decimal.rs |
|
3175 |
test_integer.rs |
|
2202 |
test_key.rs |
|
602 |
test_parser.rs |
|
34128 |
test_ref_serializer.rs |
|
3638 |
test_serializer.rs |
|
12329 |
test_string.rs |
|
477 |
test_token.rs |
|
622 |
token.rs |
|
5691 |
utils.rs |
|
1263 |
visitor.rs |
|
16446 |