FormData
struct FormDataA name → value(s) multimap, in insertion order.
Backs the Form extractor; mirrors the API of HeaderMap so
handlers can write the same code shape against headers, query
strings, and form bodies.
Internally two parallel lists keep insertion order stable (lookups are O(n), n is typically tiny — sub-100 fields). For larger forms the dict-of-lists layout would be a future optimisation; the bench harness has not pushed past 32 fields.
Implements Copyable, Defaultable, Movable
__init__
def __init__(out self) get
def get(self, name: String) -> String Return the first value for name (case-sensitive), else "".
get_optional
def get_optional(self, name: String) -> Optional[String] Return Some(value) if name is present, None otherwise.
get_all
def get_all(self, name: String) -> List[String] Return every value bound to name in insertion order.
append
def append(mut self, name: String, value: String) Append (name, value); existing bindings are preserved.
contains
def contains(self, name: String) -> Bool Return True if any binding for name exists.
len
def len(self) -> Int Return the total number of bindings (counting duplicate keys).
keys
def keys(self) -> List[String] Return the list of keys (with duplicates) in insertion order.
values
def values(self) -> List[String] Return the list of values in insertion order, parallel to keys().
to_urlencoded
def to_urlencoded(self) -> String Serialise back to application/x-www-form-urlencoded.
Round-trips parse_form_urlencoded for any well-formed
input. Uses + for spaces and %XX for everything else
outside the unreserved set.