pub struct ParamList { /* private fields */ }Expand description
Fixed-capacity, inline parameter storage for the parser hot path.
Sequences may be split across feed_with calls, so parameters cannot be
borrowed from the input and must be buffered by the parser. This type does
so with a bounded, inline arena so that parsing is allocation-free (and
memcpy-only) for all input:
- at most
MAX_PARAMSparameters per sequence; - at most
MAX_PARAM_LENbytes per parameter; - at most
MAX_PARAM_BYTESparameter bytes in total per sequence.
Implementations§
Source§impl ParamList
impl ParamList
Sourcepub fn iter(&self) -> ParamListIter<'_> ⓘ
pub fn iter(&self) -> ParamListIter<'_> ⓘ
The collected parameters, as byte slices.
Sourcepub fn overflowed(&self) -> bool
pub fn overflowed(&self) -> bool
Whether any parameter bytes were dropped: bytes past a parameter’s
MAX_PARAM_LEN cap, or parameters past the MAX_PARAMS /
MAX_PARAM_BYTES sequence caps.
Sourcepub fn push_param(&mut self, param: &[u8])
pub fn push_param(&mut self, param: &[u8])
Append a parameter, clamping on overflow (see the type docs).
Bytes beyond MAX_PARAM_LEN within the current parameter, and any
parameter that does not fit the remaining sequence capacity, are
dropped; parsing continues normally. Sets
overflowed if anything was dropped.