Skip to main content

combined

Function combined 

Source
pub fn combined<'a, I>(
    lines: I,
    limits: &Limits,
) -> Result<CombinedList<'a, I::IntoIter>, ParseError>
where I: IntoIterator<Item = &'a [u8]>, I::IntoIter: Clone,
Expand description

Validates several field lines of one name as one list (RFC 9110 section 5.3), as if joined by ", ", without joining them.

An empty line adds nothing. An element never spans two lines, so a quoted string still open at the end of a line is refused. The empty-element and member budgets count across all lines.

§Errors

As parse, with ParseError::line set to the failing line.

§Examples

use parse_net::{list, Limits};

let lines: [&[u8]; 2] = [b"a, \"x", b"y\""];
assert!(list::combined(lines, &Limits::DEFAULT).is_err());