pub struct TraceState { /* private fields */ }Expand description
A tracestate list: key=value members, at most 32, each key once, in order (§3.3).
Display writes the header value, members joined by ,.
Implementations§
Source§impl TraceState
impl TraceState
pub fn new() -> TraceState
Sourcepub fn parse<'a>(fields: impl IntoIterator<Item = &'a str>) -> TraceState
pub fn parse<'a>(fields: impl IntoIterator<Item = &'a str>) -> TraceState
The list every field value under tracestate carries, the fields read as one list in
order (RFC 9110 §5.3). Whitespace around a member is ignored and an empty member skipped.
More than 32 members, or any member off the key or value grammar, discards the whole list,
as the W3C test suite’s strict level expects; a key repeated keeps its leftmost entry.
pub fn get(&self, key: &str) -> Option<&str>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn with_entry(&self, key: &str, value: &str) -> Option<TraceState>
pub fn with_entry(&self, key: &str, value: &str) -> Option<TraceState>
The list with key=value added as §3.5 has a vendor add its own: at the left, an older
entry for the key dropped, then the list truncated to 32 members and 512 characters by
whole entries, those over 128 characters first and then from the right, never the entry
added. None when the key or the value is off the grammar.
Sourcepub fn prepend(&self, front: &TraceState) -> TraceState
pub fn prepend(&self, front: &TraceState) -> TraceState
The list with front’s members at the left, in their order, as a caller’s entries enter
an originated context’s list (§3.5, integrations §6.3): a key in both moves left with
front’s value, the entries of self that front does not name follow in their order,
and the list is truncated as with_entry truncates it, front’s
members the last removed.