/rust/registry/src/index.crates.io-1949cf8c6b5b557f/nom-7.1.3/src/multi/mod.rs
Line | Count | Source |
1 | | //! Combinators applying their child parser multiple times |
2 | | |
3 | | #[cfg(test)] |
4 | | mod tests; |
5 | | |
6 | | use crate::error::ErrorKind; |
7 | | use crate::error::ParseError; |
8 | | use crate::internal::{Err, IResult, Needed, Parser}; |
9 | | #[cfg(feature = "alloc")] |
10 | | use crate::lib::std::vec::Vec; |
11 | | use crate::traits::{InputLength, InputTake, ToUsize}; |
12 | | use core::num::NonZeroUsize; |
13 | | |
14 | | /// Don't pre-allocate more than 64KiB when calling `Vec::with_capacity`. |
15 | | /// |
16 | | /// Pre-allocating memory is a nice optimization but count fields can't |
17 | | /// always be trusted. We should clamp initial capacities to some reasonable |
18 | | /// amount. This reduces the risk of a bogus count value triggering a panic |
19 | | /// due to an OOM error. |
20 | | /// |
21 | | /// This does not affect correctness. Nom will always read the full number |
22 | | /// of elements regardless of the capacity cap. |
23 | | #[cfg(feature = "alloc")] |
24 | | const MAX_INITIAL_CAPACITY_BYTES: usize = 65536; |
25 | | |
26 | | /// Repeats the embedded parser, gathering the results in a `Vec`. |
27 | | /// |
28 | | /// This stops on [`Err::Error`] and returns the results that were accumulated. To instead chain an error up, see |
29 | | /// [`cut`][crate::combinator::cut]. |
30 | | /// |
31 | | /// # Arguments |
32 | | /// * `f` The parser to apply. |
33 | | /// |
34 | | /// *Note*: if the parser passed in accepts empty inputs (like `alpha0` or `digit0`), `many0` will |
35 | | /// return an error, to prevent going into an infinite loop |
36 | | /// |
37 | | /// ```rust |
38 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
39 | | /// use nom::multi::many0; |
40 | | /// use nom::bytes::complete::tag; |
41 | | /// |
42 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
43 | | /// many0(tag("abc"))(s) |
44 | | /// } |
45 | | /// |
46 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
47 | | /// assert_eq!(parser("abc123"), Ok(("123", vec!["abc"]))); |
48 | | /// assert_eq!(parser("123123"), Ok(("123123", vec![]))); |
49 | | /// assert_eq!(parser(""), Ok(("", vec![]))); |
50 | | /// ``` |
51 | | #[cfg(feature = "alloc")] |
52 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
53 | 1.19M | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
54 | 1.19M | where |
55 | 1.19M | I: Clone + InputLength, |
56 | 1.19M | F: Parser<I, O, E>, |
57 | 1.19M | E: ParseError<I>, |
58 | | { |
59 | 1.11M | move |mut i: I| { |
60 | 1.11M | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); |
61 | | loop { |
62 | 50.2M | let len = i.input_len(); |
63 | 50.2M | match f.parse(i.clone()) { |
64 | 1.11M | Err(Err::Error(_)) => return Ok((i, acc)), |
65 | 146 | Err(e) => return Err(e), |
66 | 49.1M | Ok((i1, o)) => { |
67 | | // infinite loop check: the parser must always consume |
68 | 49.1M | if i1.input_len() == len { |
69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); |
70 | 49.1M | } |
71 | | |
72 | 49.1M | i = i1; |
73 | 49.1M | acc.push(o); |
74 | | } |
75 | | } |
76 | | } |
77 | 1.11M | } nom::multi::many0::<&[u8], (&str, core::option::Option<&str>, &[u8]), nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], &[u8], (&str, core::option::Option<&str>, &[u8]), nom::error::Error<&[u8]>, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::sequence::tuple<&[u8], (&str, core::option::Option<&str>, &[u8]), nom::error::Error<&[u8]>, (nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::bytes::complete::take_while<nom::character::is_alphabetic, &[u8], nom::error::Error<&[u8]>>::{closure#0}, core::str::converts::from_utf8>::{closure#0}, nom::combinator::opt<&[u8], &str, nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], char, &str, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::bytes::complete::take_till<suricata::sdp::parser::is_line_ending, &[u8], nom::error::Error<&[u8]>>::{closure#0}, core::str::converts::from_utf8>::{closure#0}>::{closure#0}>::{closure#0}, nom::character::complete::line_ending<&[u8], nom::error::Error<&[u8]>>)>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 15 | move |mut i: I| { | 60 | 15 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 64 | let len = i.input_len(); | 63 | 64 | match f.parse(i.clone()) { | 64 | 15 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 49 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 49 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 49 | } | 71 | | | 72 | 49 | i = i1; | 73 | 49 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 15 | } |
nom::multi::many0::<&[u8], (&str, char, &str, &[u8]), nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], &[u8], (&str, char, &str, &[u8]), nom::error::Error<&[u8]>, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::sequence::tuple<&[u8], (&str, char, &str, &[u8]), nom::error::Error<&[u8]>, (nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::branch::alt<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0})>::{closure#0}, core::str::converts::from_utf8>::{closure#0}, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, nom::character::complete::line_ending<&[u8], nom::error::Error<&[u8]>>)>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 15 | move |mut i: I| { | 60 | 15 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 16 | let len = i.input_len(); | 63 | 16 | match f.parse(i.clone()) { | 64 | 15 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 1 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 1 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 1 | } | 71 | | | 72 | 1 | i = i1; | 73 | 1 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 15 | } |
nom::multi::many0::<&[u8], suricata::sdp::parser::MediaDescription, nom::error::Error<&[u8]>, suricata::sdp::parser::parse_media_description>::{closure#0}Line | Count | Source | 59 | 8 | move |mut i: I| { | 60 | 8 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 15 | let len = i.input_len(); | 63 | 15 | match f.parse(i.clone()) { | 64 | 8 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 7 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 7 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 7 | } | 71 | | | 72 | 7 | i = i1; | 73 | 7 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 8 | } |
nom::multi::many0::<&[u8], suricata::quic::frames::Frame, suricata::quic::error::QuicError, nom::combinator::complete<&[u8], suricata::quic::frames::Frame, suricata::quic::error::QuicError, <suricata::quic::frames::Frame>::decode_frame>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 131k | move |mut i: I| { | 60 | 131k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 185k | let len = i.input_len(); | 63 | 185k | match f.parse(i.clone()) { | 64 | 131k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 54.1k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 54.1k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 54.1k | } | 71 | | | 72 | 54.1k | i = i1; | 73 | 54.1k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 131k | } |
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman>::{closure#0}Line | Count | Source | 59 | 278k | move |mut i: I| { | 60 | 278k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 22.3M | let len = i.input_len(); | 63 | 22.3M | match f.parse(i.clone()) { | 64 | 278k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 22.0M | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 22.0M | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 22.0M | } | 71 | | | 72 | 22.0M | i = i1; | 73 | 22.0M | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 278k | } |
nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node>::{closure#0}Line | Count | Source | 59 | 2 | move |mut i: I| { | 60 | 2 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 2 | let len = i.input_len(); | 63 | 2 | match f.parse(i.clone()) { | 64 | 2 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 0 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 0 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 0 | } | 71 | | | 72 | 0 | i = i1; | 73 | 0 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node6>::{closure#0}nom::multi::many0::<&[u8], suricata::ike::parser::SaAttribute, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::ike::parser::SaAttribute, nom::error::Error<&[u8]>, suricata::ike::parser::parse_sa_attribute::parse_attribute>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 20 | move |mut i: I| { | 60 | 20 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 100 | let len = i.input_len(); | 63 | 100 | match f.parse(i.clone()) { | 64 | 20 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 80 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 80 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 80 | } | 71 | | | 72 | 80 | i = i1; | 73 | 80 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 20 | } |
nom::multi::many0::<&[u8], suricata::ike::parser::IsakmpPayload, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::ike::parser::IsakmpPayload, nom::error::Error<&[u8]>, suricata::ike::parser::parse_ikev1_payload_list::parse_payload>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 40 | move |mut i: I| { | 60 | 40 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 215 | let len = i.input_len(); | 63 | 215 | match f.parse(i.clone()) { | 64 | 40 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 175 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 175 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 175 | } | 71 | | | 72 | 175 | i = i1; | 73 | 175 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 40 | } |
nom::multi::many0::<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, suricata::http2::parser::http2_parse_frame_setting>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 18.9k | move |mut i: I| { | 60 | 18.9k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 19.7k | let len = i.input_len(); | 63 | 19.7k | match f.parse(i.clone()) { | 64 | 18.9k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 859 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 859 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 859 | } | 71 | | | 72 | 859 | i = i1; | 73 | 859 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 18.9k | } |
nom::multi::many0::<&[u8], alloc::string::String, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], alloc::string::String, nom::error::Error<&[u8]>, suricata::mqtt::parser::parse_mqtt_string>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 94.9k | move |mut i: I| { | 60 | 94.9k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 98.1k | let len = i.input_len(); | 63 | 98.1k | match f.parse(i.clone()) { | 64 | 94.9k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 3.25k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 3.25k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 3.25k | } | 71 | | | 72 | 3.25k | i = i1; | 73 | 3.25k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 94.9k | } |
nom::multi::many0::<&[u8], u8, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 83.8k | move |mut i: I| { | 60 | 83.8k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 1.89M | let len = i.input_len(); | 63 | 1.89M | match f.parse(i.clone()) { | 64 | 83.8k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 1.80M | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 1.80M | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 1.80M | } | 71 | | | 72 | 1.80M | i = i1; | 73 | 1.80M | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 83.8k | } |
nom::multi::many0::<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, suricata::nfs::nfs3_records::parse_nfs3_response_readdirplus_entry_cond>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 3.78k | move |mut i: I| { | 60 | 3.78k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 9.28k | let len = i.input_len(); | 63 | 9.28k | match f.parse(i.clone()) { | 64 | 3.78k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 5.50k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 5.50k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 5.50k | } | 71 | | | 72 | 5.50k | i = i1; | 73 | 5.50k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 3.78k | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 86.8k | move |mut i: I| { | 60 | 86.8k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 94.1k | let len = i.input_len(); | 63 | 94.1k | match f.parse(i.clone()) { | 64 | 86.8k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 7.29k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 7.29k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 7.29k | } | 71 | | | 72 | 7.29k | i = i1; | 73 | 7.29k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 86.8k | } |
nom::multi::many0::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 16 | move |mut i: I| { | 60 | 16 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 55 | let len = i.input_len(); | 63 | 55 | match f.parse(i.clone()) { | 64 | 16 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 39 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 39 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 39 | } | 71 | | | 72 | 39 | i = i1; | 73 | 39 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 16 | } |
nom::multi::many0::<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, <ldap_parser::ldap::Control as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 3.93k | move |mut i: I| { | 60 | 3.93k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 3.94k | let len = i.input_len(); | 63 | 3.94k | match f.parse(i.clone()) { | 64 | 3.93k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 14 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 14 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 14 | } | 71 | | | 72 | 14 | i = i1; | 73 | 14 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 3.93k | } |
nom::multi::many0::<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, <x509_parser::x509::RelativeDistinguishedName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.17k | move |mut i: I| { | 60 | 2.17k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 10.5k | let len = i.input_len(); | 63 | 10.5k | match f.parse(i.clone()) { | 64 | 2.17k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 8.33k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 8.33k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 8.33k | } | 71 | | | 72 | 8.33k | i = i1; | 73 | 8.33k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.17k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, x509_parser::extensions::X509ExtensionParser>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, <x509_parser::extensions::X509Extension as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 1.01k | move |mut i: I| { | 60 | 1.01k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 6.54k | let len = i.input_len(); | 63 | 6.54k | match f.parse(i.clone()) { | 64 | 1.01k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 5.53k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 5.53k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 5.53k | } | 71 | | | 72 | 5.53k | i = i1; | 73 | 5.53k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 1.01k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, x509_parser::extensions::parser::parse_authorityinfoaccess::parse_aia>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 933 | move |mut i: I| { | 60 | 933 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 2.05k | let len = i.input_len(); | 63 | 2.05k | match f.parse(i.clone()) { | 64 | 927 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 6 | Err(e) => return Err(e), | 66 | 1.11k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 1.11k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 1.11k | } | 71 | | | 72 | 1.11k | i = i1; | 73 | 1.11k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 933 | } |
nom::multi::many0::<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_information>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 7 | move |mut i: I| { | 60 | 7 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 18 | let len = i.input_len(); | 63 | 18 | match f.parse(i.clone()) { | 64 | 7 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 11 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 11 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 11 | } | 71 | | | 72 | 11 | i = i1; | 73 | 11 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 7 | } |
nom::multi::many0::<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, x509_parser::extensions::parser::parse_crldistributionpoint>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 995 | move |mut i: I| { | 60 | 995 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 1.99k | let len = i.input_len(); | 63 | 1.99k | match f.parse(i.clone()) { | 64 | 992 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 3 | Err(e) => return Err(e), | 66 | 995 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 995 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 995 | } | 71 | | | 72 | 995 | i = i1; | 73 | 995 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 995 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, <x509_parser::cri_attributes::X509CriAttribute as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, <x509_parser::revocation_list::RevokedCertificate as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, <x509_parser::extensions::generalname::GeneralName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 738 | move |mut i: I| { | 60 | 738 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 18.0k | let len = i.input_len(); | 63 | 18.0k | match f.parse(i.clone()) { | 64 | 715 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 23 | Err(e) => return Err(e), | 66 | 17.3k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 17.3k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 17.3k | } | 71 | | | 72 | 17.3k | i = i1; | 73 | 17.3k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 738 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_client_hello_extension>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_server_hello_extension>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::map<&[u8], &[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, tls_parser::tls::parse_certs::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 11 | move |mut i: I| { | 60 | 11 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 18 | let len = i.input_len(); | 63 | 18 | match f.parse(i.clone()) { | 64 | 11 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 7 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 7 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 7 | } | 71 | | | 72 | 7 | i = i1; | 73 | 7 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 11 | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.31k | move |mut i: I| { | 60 | 2.31k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 8.89k | let len = i.input_len(); | 63 | 8.89k | match f.parse(i.clone()) { | 64 | 2.31k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 6.58k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 6.58k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 6.58k | } | 71 | | | 72 | 6.58k | i = i1; | 73 | 6.58k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.31k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_protocol_name>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_oid_filter>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, tls_parser::certificate_transparency::parse_ct_signed_certificate_timestamp>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension_sni_hostname>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], u16, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.31k | move |mut i: I| { | 60 | 2.31k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 11.2k | let len = i.input_len(); | 63 | 11.2k | match f.parse(i.clone()) { | 64 | 2.31k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 8.90k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 8.90k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 8.90k | } | 71 | | | 72 | 8.90k | i = i1; | 73 | 8.90k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.31k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, <kerberos_parser::krb5::HostAddress as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, <kerberos_parser::krb5::PAData as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 1 | move |mut i: I| { | 60 | 1 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 2 | let len = i.input_len(); | 63 | 2 | match f.parse(i.clone()) { | 64 | 1 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 1 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 1 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 1 | } | 71 | | | 72 | 1 | i = i1; | 73 | 1 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 1 | } |
nom::multi::many0::<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::complete<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::cut<&[u8], alloc::string::String, asn1_rs::error::Error, kerberos_parser::krb5_parser::parse_kerberos_string>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 11 | move |mut i: I| { | 60 | 11 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 28 | let len = i.input_len(); | 63 | 28 | match f.parse(i.clone()) { | 64 | 10 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 1 | Err(e) => return Err(e), | 66 | 17 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 17 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 17 | } | 71 | | | 72 | 17 | i = i1; | 73 | 17 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 11 | } |
Unexecuted instantiation: nom::multi::many0::<_, _, _, _>::{closure#0}nom::multi::many0::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapString as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 43 | move |mut i: I| { | 60 | 43 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 74 | let len = i.input_len(); | 63 | 74 | match f.parse(i.clone()) { | 64 | 43 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 31 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 31 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 31 | } | 71 | | | 72 | 31 | i = i1; | 73 | 31 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 43 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, <ldap_parser::filter::PartialAttribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 3.03k | move |mut i: I| { | 60 | 3.03k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 3.04k | let len = i.input_len(); | 63 | 3.04k | match f.parse(i.clone()) { | 64 | 3.03k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 16 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 16 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 16 | } | 71 | | | 72 | 16 | i = i1; | 73 | 16 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 3.03k | } |
nom::multi::many0::<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, <ldap_parser::filter::Attribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 9.48k | move |mut i: I| { | 60 | 9.48k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 9.49k | let len = i.input_len(); | 63 | 9.49k | match f.parse(i.clone()) { | 64 | 9.48k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 12 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 12 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 12 | } | 71 | | | 72 | 12 | i = i1; | 73 | 12 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 9.48k | } |
nom::multi::many0::<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, suricata::nfs::nfs3_records::parse_nfs3_response_readdirplus_entry_cond>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 9.75k | move |mut i: I| { | 60 | 9.75k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 43.8k | let len = i.input_len(); | 63 | 43.8k | match f.parse(i.clone()) { | 64 | 9.75k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 34.1k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 34.1k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 34.1k | } | 71 | | | 72 | 34.1k | i = i1; | 73 | 34.1k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 9.75k | } |
nom::multi::many0::<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, suricata::http2::parser::http2_parse_frame_setting>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 7.35k | move |mut i: I| { | 60 | 7.35k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 21.6k | let len = i.input_len(); | 63 | 21.6k | match f.parse(i.clone()) { | 64 | 7.35k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 14.2k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 14.2k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 14.2k | } | 71 | | | 72 | 14.2k | i = i1; | 73 | 14.2k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 7.35k | } |
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman>::{closure#0}Line | Count | Source | 59 | 332k | move |mut i: I| { | 60 | 332k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 25.1M | let len = i.input_len(); | 63 | 25.1M | match f.parse(i.clone()) { | 64 | 332k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 24.8M | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 24.8M | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 24.8M | } | 71 | | | 72 | 24.8M | i = i1; | 73 | 24.8M | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 332k | } |
nom::multi::many0::<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, <x509_parser::x509::RelativeDistinguishedName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 6.48k | move |mut i: I| { | 60 | 6.48k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 34.1k | let len = i.input_len(); | 63 | 34.1k | match f.parse(i.clone()) { | 64 | 6.48k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 27.7k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 27.7k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 27.7k | } | 71 | | | 72 | 27.7k | i = i1; | 73 | 27.7k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 6.48k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 6 | move |mut i: I| { | 60 | 6 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 11 | let len = i.input_len(); | 63 | 11 | match f.parse(i.clone()) { | 64 | 6 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 5 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 5 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 5 | } | 71 | | | 72 | 5 | i = i1; | 73 | 5 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 6 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, x509_parser::extensions::X509ExtensionParser>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, <x509_parser::extensions::X509Extension as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.74k | move |mut i: I| { | 60 | 2.74k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 23.1k | let len = i.input_len(); | 63 | 23.1k | match f.parse(i.clone()) { | 64 | 2.74k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 20.3k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 20.3k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 20.3k | } | 71 | | | 72 | 20.3k | i = i1; | 73 | 20.3k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.74k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, x509_parser::extensions::parser::parse_authorityinfoaccess::parse_aia>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.36k | move |mut i: I| { | 60 | 2.36k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 6.47k | let len = i.input_len(); | 63 | 6.47k | match f.parse(i.clone()) { | 64 | 2.35k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 13 | Err(e) => return Err(e), | 66 | 4.11k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 4.11k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 4.11k | } | 71 | | | 72 | 4.11k | i = i1; | 73 | 4.11k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.36k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_information>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 1.77k | move |mut i: I| { | 60 | 1.77k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 4.28k | let len = i.input_len(); | 63 | 4.28k | match f.parse(i.clone()) { | 64 | 1.77k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 4 | Err(e) => return Err(e), | 66 | 2.50k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 2.50k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 2.50k | } | 71 | | | 72 | 2.50k | i = i1; | 73 | 2.50k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 1.77k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, x509_parser::extensions::parser::parse_crldistributionpoint>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.38k | move |mut i: I| { | 60 | 2.38k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 5.41k | let len = i.input_len(); | 63 | 5.41k | match f.parse(i.clone()) { | 64 | 2.37k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 8 | Err(e) => return Err(e), | 66 | 3.03k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 3.03k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 3.03k | } | 71 | | | 72 | 3.03k | i = i1; | 73 | 3.03k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.38k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, <x509_parser::cri_attributes::X509CriAttribute as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, <x509_parser::revocation_list::RevokedCertificate as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, <x509_parser::extensions::generalname::GeneralName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.21k | move |mut i: I| { | 60 | 2.21k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 153k | let len = i.input_len(); | 63 | 153k | match f.parse(i.clone()) { | 64 | 2.17k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 39 | Err(e) => return Err(e), | 66 | 150k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 150k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 150k | } | 71 | | | 72 | 150k | i = i1; | 73 | 150k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.21k | } |
nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.86k | move |mut i: I| { | 60 | 2.86k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 10.5k | let len = i.input_len(); | 63 | 10.5k | match f.parse(i.clone()) { | 64 | 2.86k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 7.70k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 7.70k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 7.70k | } | 71 | | | 72 | 7.70k | i = i1; | 73 | 7.70k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.86k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_client_hello_extension>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_server_hello_extension>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::map<&[u8], &[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, tls_parser::tls::parse_certs::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 46 | move |mut i: I| { | 60 | 46 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 431 | let len = i.input_len(); | 63 | 431 | match f.parse(i.clone()) { | 64 | 46 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 385 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 385 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 385 | } | 71 | | | 72 | 385 | i = i1; | 73 | 385 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 46 | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 9 | move |mut i: I| { | 60 | 9 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 30 | let len = i.input_len(); | 63 | 30 | match f.parse(i.clone()) { | 64 | 9 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 21 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 21 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 21 | } | 71 | | | 72 | 21 | i = i1; | 73 | 21 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 9 | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_protocol_name>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 204 | move |mut i: I| { | 60 | 204 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 393 | let len = i.input_len(); | 63 | 393 | match f.parse(i.clone()) { | 64 | 204 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 189 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 189 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 189 | } | 71 | | | 72 | 189 | i = i1; | 73 | 189 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 204 | } |
nom::multi::many0::<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_oid_filter>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 3 | move |mut i: I| { | 60 | 3 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 3 | let len = i.input_len(); | 63 | 3 | match f.parse(i.clone()) { | 64 | 3 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 0 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 0 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 0 | } | 71 | | | 72 | 0 | i = i1; | 73 | 0 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 3 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, tls_parser::certificate_transparency::parse_ct_signed_certificate_timestamp>::{closure#0}>::{closure#0}nom::multi::many0::<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension_sni_hostname>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 283 | move |mut i: I| { | 60 | 283 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 451 | let len = i.input_len(); | 63 | 451 | match f.parse(i.clone()) { | 64 | 283 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 168 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 168 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 168 | } | 71 | | | 72 | 168 | i = i1; | 73 | 168 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 283 | } |
nom::multi::many0::<&[u8], u16, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 258 | move |mut i: I| { | 60 | 258 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 2.06k | let len = i.input_len(); | 63 | 2.06k | match f.parse(i.clone()) { | 64 | 258 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 1.80k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 1.80k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 1.80k | } | 71 | | | 72 | 1.80k | i = i1; | 73 | 1.80k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 258 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 360 | move |mut i: I| { | 60 | 360 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 733 | let len = i.input_len(); | 63 | 733 | match f.parse(i.clone()) { | 64 | 360 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 373 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 373 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 373 | } | 71 | | | 72 | 373 | i = i1; | 73 | 373 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 360 | } |
nom::multi::many0::<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, <ldap_parser::ldap::Control as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 3.16k | move |mut i: I| { | 60 | 3.16k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 3.28k | let len = i.input_len(); | 63 | 3.28k | match f.parse(i.clone()) { | 64 | 3.16k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 119 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 119 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 119 | } | 71 | | | 72 | 119 | i = i1; | 73 | 119 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 3.16k | } |
nom::multi::many0::<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, <kerberos_parser::krb5::HostAddress as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 98 | move |mut i: I| { | 60 | 98 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 187 | let len = i.input_len(); | 63 | 187 | match f.parse(i.clone()) { | 64 | 93 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 5 | Err(e) => return Err(e), | 66 | 89 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 89 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 89 | } | 71 | | | 72 | 89 | i = i1; | 73 | 89 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 98 | } |
nom::multi::many0::<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, <kerberos_parser::krb5::PAData as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 2.72k | move |mut i: I| { | 60 | 2.72k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 5.57k | let len = i.input_len(); | 63 | 5.57k | match f.parse(i.clone()) { | 64 | 2.71k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 15 | Err(e) => return Err(e), | 66 | 2.84k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 2.84k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 2.84k | } | 71 | | | 72 | 2.84k | i = i1; | 73 | 2.84k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 2.72k | } |
nom::multi::many0::<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::complete<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::cut<&[u8], alloc::string::String, asn1_rs::error::Error, kerberos_parser::krb5_parser::parse_kerberos_string>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 7.76k | move |mut i: I| { | 60 | 7.76k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 20.8k | let len = i.input_len(); | 63 | 20.8k | match f.parse(i.clone()) { | 64 | 7.73k | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 29 | Err(e) => return Err(e), | 66 | 13.0k | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 13.0k | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 13.0k | } | 71 | | | 72 | 13.0k | i = i1; | 73 | 13.0k | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 7.76k | } |
Unexecuted instantiation: nom::multi::many0::<_, _, _, _>::{closure#0}nom::multi::many0::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapString as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 177 | move |mut i: I| { | 60 | 177 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 395 | let len = i.input_len(); | 63 | 395 | match f.parse(i.clone()) { | 64 | 177 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 218 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 218 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 218 | } | 71 | | | 72 | 218 | i = i1; | 73 | 218 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 177 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, <ldap_parser::filter::PartialAttribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 326 | move |mut i: I| { | 60 | 326 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 625 | let len = i.input_len(); | 63 | 625 | match f.parse(i.clone()) { | 64 | 326 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 299 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 299 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 299 | } | 71 | | | 72 | 299 | i = i1; | 73 | 299 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 326 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, <ldap_parser::filter::Attribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 59 | 70 | move |mut i: I| { | 60 | 70 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | 135 | let len = i.input_len(); | 63 | 135 | match f.parse(i.clone()) { | 64 | 70 | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | 0 | Err(e) => return Err(e), | 66 | 65 | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | 65 | if i1.input_len() == len { | 69 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | 65 | } | 71 | | | 72 | 65 | i = i1; | 73 | 65 | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | 70 | } |
|
78 | 1.19M | } nom::multi::many0::<&[u8], suricata::sdp::parser::MediaDescription, nom::error::Error<&[u8]>, suricata::sdp::parser::parse_media_description> Line | Count | Source | 53 | 8 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 8 | where | 55 | 8 | I: Clone + InputLength, | 56 | 8 | F: Parser<I, O, E>, | 57 | 8 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 8 | } |
nom::multi::many0::<&[u8], (&str, core::option::Option<&str>, &[u8]), nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], &[u8], (&str, core::option::Option<&str>, &[u8]), nom::error::Error<&[u8]>, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::sequence::tuple<&[u8], (&str, core::option::Option<&str>, &[u8]), nom::error::Error<&[u8]>, (nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::bytes::complete::take_while<nom::character::is_alphabetic, &[u8], nom::error::Error<&[u8]>>::{closure#0}, core::str::converts::from_utf8>::{closure#0}, nom::combinator::opt<&[u8], &str, nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], char, &str, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::bytes::complete::take_till<suricata::sdp::parser::is_line_ending, &[u8], nom::error::Error<&[u8]>>::{closure#0}, core::str::converts::from_utf8>::{closure#0}>::{closure#0}>::{closure#0}, nom::character::complete::line_ending<&[u8], nom::error::Error<&[u8]>>)>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 15 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 15 | where | 55 | 15 | I: Clone + InputLength, | 56 | 15 | F: Parser<I, O, E>, | 57 | 15 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 15 | } |
nom::multi::many0::<&[u8], (&str, char, &str, &[u8]), nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], &[u8], (&str, char, &str, &[u8]), nom::error::Error<&[u8]>, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::sequence::tuple<&[u8], (&str, char, &str, &[u8]), nom::error::Error<&[u8]>, (nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::branch::alt<&[u8], &[u8], nom::error::Error<&[u8]>, (nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0})>::{closure#0}, core::str::converts::from_utf8>::{closure#0}, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>, core::str::converts::from_utf8>::{closure#0}, nom::character::complete::line_ending<&[u8], nom::error::Error<&[u8]>>)>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 15 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 15 | where | 55 | 15 | I: Clone + InputLength, | 56 | 15 | F: Parser<I, O, E>, | 57 | 15 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 15 | } |
nom::multi::many0::<&[u8], suricata::quic::frames::Frame, suricata::quic::error::QuicError, nom::combinator::complete<&[u8], suricata::quic::frames::Frame, suricata::quic::error::QuicError, <suricata::quic::frames::Frame>::decode_frame>::{closure#0}>Line | Count | Source | 53 | 131k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 131k | where | 55 | 131k | I: Clone + InputLength, | 56 | 131k | F: Parser<I, O, E>, | 57 | 131k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 131k | } |
nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node> Line | Count | Source | 53 | 2 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2 | where | 55 | 2 | I: Clone + InputLength, | 56 | 2 | F: Parser<I, O, E>, | 57 | 2 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node6> nom::multi::many0::<&[u8], suricata::ike::parser::SaAttribute, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::ike::parser::SaAttribute, nom::error::Error<&[u8]>, suricata::ike::parser::parse_sa_attribute::parse_attribute>::{closure#0}>Line | Count | Source | 53 | 20 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 20 | where | 55 | 20 | I: Clone + InputLength, | 56 | 20 | F: Parser<I, O, E>, | 57 | 20 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 20 | } |
nom::multi::many0::<&[u8], suricata::ike::parser::IsakmpPayload, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::ike::parser::IsakmpPayload, nom::error::Error<&[u8]>, suricata::ike::parser::parse_ikev1_payload_list::parse_payload>::{closure#0}>Line | Count | Source | 53 | 40 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 40 | where | 55 | 40 | I: Clone + InputLength, | 56 | 40 | F: Parser<I, O, E>, | 57 | 40 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 40 | } |
nom::multi::many0::<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, suricata::http2::parser::http2_parse_frame_setting>::{closure#0}>Line | Count | Source | 53 | 18.9k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 18.9k | where | 55 | 18.9k | I: Clone + InputLength, | 56 | 18.9k | F: Parser<I, O, E>, | 57 | 18.9k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 18.9k | } |
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman> Line | Count | Source | 53 | 278k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 278k | where | 55 | 278k | I: Clone + InputLength, | 56 | 278k | F: Parser<I, O, E>, | 57 | 278k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 278k | } |
nom::multi::many0::<&[u8], alloc::string::String, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], alloc::string::String, nom::error::Error<&[u8]>, suricata::mqtt::parser::parse_mqtt_string>::{closure#0}>Line | Count | Source | 53 | 94.9k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 94.9k | where | 55 | 94.9k | I: Clone + InputLength, | 56 | 94.9k | F: Parser<I, O, E>, | 57 | 94.9k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 94.9k | } |
nom::multi::many0::<&[u8], u8, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>Line | Count | Source | 53 | 83.8k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 83.8k | where | 55 | 83.8k | I: Clone + InputLength, | 56 | 83.8k | F: Parser<I, O, E>, | 57 | 83.8k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 83.8k | } |
nom::multi::many0::<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, suricata::nfs::nfs3_records::parse_nfs3_response_readdirplus_entry_cond>::{closure#0}>Line | Count | Source | 53 | 3.78k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 3.78k | where | 55 | 3.78k | I: Clone + InputLength, | 56 | 3.78k | F: Parser<I, O, E>, | 57 | 3.78k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 3.78k | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::complete::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>Line | Count | Source | 53 | 165k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 165k | where | 55 | 165k | I: Clone + InputLength, | 56 | 165k | F: Parser<I, O, E>, | 57 | 165k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 165k | } |
nom::multi::many0::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>Line | Count | Source | 53 | 16 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 16 | where | 55 | 16 | I: Clone + InputLength, | 56 | 16 | F: Parser<I, O, E>, | 57 | 16 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 16 | } |
nom::multi::many0::<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, <ldap_parser::ldap::Control as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 3.93k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 3.93k | where | 55 | 3.93k | I: Clone + InputLength, | 56 | 3.93k | F: Parser<I, O, E>, | 57 | 3.93k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 3.93k | } |
nom::multi::many0::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapString as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 137 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 137 | where | 55 | 137 | I: Clone + InputLength, | 56 | 137 | F: Parser<I, O, E>, | 57 | 137 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 137 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, <ldap_parser::filter::PartialAttribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 3.15k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 3.15k | where | 55 | 3.15k | I: Clone + InputLength, | 56 | 3.15k | F: Parser<I, O, E>, | 57 | 3.15k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 3.15k | } |
nom::multi::many0::<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, <ldap_parser::filter::Attribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 13.5k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 13.5k | where | 55 | 13.5k | I: Clone + InputLength, | 56 | 13.5k | F: Parser<I, O, E>, | 57 | 13.5k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 13.5k | } |
nom::multi::many0::<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, <x509_parser::x509::RelativeDistinguishedName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Line | Count | Source | 53 | 2.17k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.17k | where | 55 | 2.17k | I: Clone + InputLength, | 56 | 2.17k | F: Parser<I, O, E>, | 57 | 2.17k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.17k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, x509_parser::extensions::X509ExtensionParser>::{closure#0}>nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, <x509_parser::extensions::X509Extension as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Line | Count | Source | 53 | 1.01k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 1.01k | where | 55 | 1.01k | I: Clone + InputLength, | 56 | 1.01k | F: Parser<I, O, E>, | 57 | 1.01k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 1.01k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, <x509_parser::extensions::generalname::GeneralName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, <x509_parser::cri_attributes::X509CriAttribute as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, <x509_parser::revocation_list::RevokedCertificate as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_protocol_name>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_client_hello_extension>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_server_hello_extension>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_oid_filter>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension_sni_hostname>::{closure#0}>nom::multi::many0::<&[u8], u16, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>Line | Count | Source | 53 | 2.36k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.36k | where | 55 | 2.36k | I: Clone + InputLength, | 56 | 2.36k | F: Parser<I, O, E>, | 57 | 2.36k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.36k | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 4.58k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 4.58k | where | 55 | 4.58k | I: Clone + InputLength, | 56 | 4.58k | F: Parser<I, O, E>, | 57 | 4.58k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 4.58k | } |
nom::multi::many0::<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::map<&[u8], &[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, tls_parser::tls::parse_certs::{closure#0}>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 11 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 11 | where | 55 | 11 | I: Clone + InputLength, | 56 | 11 | F: Parser<I, O, E>, | 57 | 11 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 11 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, tls_parser::certificate_transparency::parse_ct_signed_certificate_timestamp>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, <kerberos_parser::krb5::HostAddress as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>nom::multi::many0::<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, <kerberos_parser::krb5::PAData as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 1 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 1 | where | 55 | 1 | I: Clone + InputLength, | 56 | 1 | F: Parser<I, O, E>, | 57 | 1 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 1 | } |
nom::multi::many0::<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::complete<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::cut<&[u8], alloc::string::String, asn1_rs::error::Error, kerberos_parser::krb5_parser::parse_kerberos_string>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 11 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 11 | where | 55 | 11 | I: Clone + InputLength, | 56 | 11 | F: Parser<I, O, E>, | 57 | 11 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 11 | } |
Unexecuted instantiation: nom::multi::many0::<_, _, _, _> nom::multi::many0::<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, x509_parser::extensions::parser::parse_authorityinfoaccess::parse_aia>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 934 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 934 | where | 55 | 934 | I: Clone + InputLength, | 56 | 934 | F: Parser<I, O, E>, | 57 | 934 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 934 | } |
nom::multi::many0::<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_information>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 7 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 7 | where | 55 | 7 | I: Clone + InputLength, | 56 | 7 | F: Parser<I, O, E>, | 57 | 7 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 7 | } |
nom::multi::many0::<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, x509_parser::extensions::parser::parse_crldistributionpoint>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 998 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 998 | where | 55 | 998 | I: Clone + InputLength, | 56 | 998 | F: Parser<I, O, E>, | 57 | 998 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 998 | } |
nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 738 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 738 | where | 55 | 738 | I: Clone + InputLength, | 56 | 738 | F: Parser<I, O, E>, | 57 | 738 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 738 | } |
nom::multi::many0::<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::nfs::nfs3_records::Nfs3ResponseReaddirplusEntry, nom::error::Error<&[u8]>, suricata::nfs::nfs3_records::parse_nfs3_response_readdirplus_entry_cond>::{closure#0}>Line | Count | Source | 53 | 9.75k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 9.75k | where | 55 | 9.75k | I: Clone + InputLength, | 56 | 9.75k | F: Parser<I, O, E>, | 57 | 9.75k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 9.75k | } |
nom::multi::many0::<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::http2::parser::HTTP2FrameSettings, nom::error::Error<&[u8]>, suricata::http2::parser::http2_parse_frame_setting>::{closure#0}>Line | Count | Source | 53 | 7.35k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 7.35k | where | 55 | 7.35k | I: Clone + InputLength, | 56 | 7.35k | F: Parser<I, O, E>, | 57 | 7.35k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 7.35k | } |
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman> Line | Count | Source | 53 | 332k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 332k | where | 55 | 332k | I: Clone + InputLength, | 56 | 332k | F: Parser<I, O, E>, | 57 | 332k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 332k | } |
nom::multi::many0::<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::RelativeDistinguishedName, x509_parser::error::X509Error, <x509_parser::x509::RelativeDistinguishedName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Line | Count | Source | 53 | 6.48k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 6.48k | where | 55 | 6.48k | I: Clone + InputLength, | 56 | 6.48k | F: Parser<I, O, E>, | 57 | 6.48k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 6.48k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>Line | Count | Source | 53 | 6 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 6 | where | 55 | 6 | I: Clone + InputLength, | 56 | 6 | F: Parser<I, O, E>, | 57 | 6 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 6 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::cri_attributes::X509CriAttribute, x509_parser::error::X509Error, <x509_parser::cri_attributes::X509CriAttribute as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::revocation_list::RevokedCertificate, x509_parser::error::X509Error, <x509_parser::revocation_list::RevokedCertificate as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_protocol_name>::{closure#0}>Line | Count | Source | 53 | 213 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 213 | where | 55 | 213 | I: Clone + InputLength, | 56 | 213 | F: Parser<I, O, E>, | 57 | 213 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 213 | } |
nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension>::{closure#0}>Line | Count | Source | 53 | 2.86k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.86k | where | 55 | 2.86k | I: Clone + InputLength, | 56 | 2.86k | F: Parser<I, O, E>, | 57 | 2.86k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.86k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_client_hello_extension>::{closure#0}>Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::TlsExtension, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_server_hello_extension>::{closure#0}>nom::multi::many0::<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls_extensions::OidFilter, nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_oid_filter>::{closure#0}>Line | Count | Source | 53 | 5 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 5 | where | 55 | 5 | I: Clone + InputLength, | 56 | 5 | F: Parser<I, O, E>, | 57 | 5 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 5 | } |
nom::multi::many0::<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], (tls_parser::tls_extensions::SNIType, &[u8]), nom::error::Error<&[u8]>, tls_parser::tls_extensions::parse_tls_extension_sni_hostname>::{closure#0}>Line | Count | Source | 53 | 300 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 300 | where | 55 | 300 | I: Clone + InputLength, | 56 | 300 | F: Parser<I, O, E>, | 57 | 300 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 300 | } |
nom::multi::many0::<&[u8], u16, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>Line | Count | Source | 53 | 309 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 309 | where | 55 | 309 | I: Clone + InputLength, | 56 | 309 | F: Parser<I, O, E>, | 57 | 309 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 309 | } |
nom::multi::many0::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 14 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 14 | where | 55 | 14 | I: Clone + InputLength, | 56 | 14 | F: Parser<I, O, E>, | 57 | 14 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 14 | } |
nom::multi::many0::<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::combinator::map<&[u8], &[u8], tls_parser::tls::RawCertificate, nom::error::Error<&[u8]>, nom::multi::length_data<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, tls_parser::tls::parse_certs::{closure#0}>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 46 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 46 | where | 55 | 46 | I: Clone + InputLength, | 56 | 46 | F: Parser<I, O, E>, | 57 | 46 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 46 | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::certificate_transparency::SignedCertificateTimestamp, nom::error::Error<&[u8]>, tls_parser::certificate_transparency::parse_ct_signed_certificate_timestamp>::{closure#0}>nom::multi::many0::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>Line | Count | Source | 53 | 360 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 360 | where | 55 | 360 | I: Clone + InputLength, | 56 | 360 | F: Parser<I, O, E>, | 57 | 360 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 360 | } |
nom::multi::many0::<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Control, ldap_parser::error::LdapError, <ldap_parser::ldap::Control as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 3.16k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 3.16k | where | 55 | 3.16k | I: Clone + InputLength, | 56 | 3.16k | F: Parser<I, O, E>, | 57 | 3.16k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 3.16k | } |
nom::multi::many0::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapString as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 335 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 335 | where | 55 | 335 | I: Clone + InputLength, | 56 | 335 | F: Parser<I, O, E>, | 57 | 335 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 335 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::PartialAttribute, ldap_parser::error::LdapError, <ldap_parser::filter::PartialAttribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 383 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 383 | where | 55 | 383 | I: Clone + InputLength, | 56 | 383 | F: Parser<I, O, E>, | 57 | 383 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 383 | } |
nom::multi::many0::<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Attribute, ldap_parser::error::LdapError, <ldap_parser::filter::Attribute as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 53 | 513 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 513 | where | 55 | 513 | I: Clone + InputLength, | 56 | 513 | F: Parser<I, O, E>, | 57 | 513 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 513 | } |
nom::multi::many0::<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::HostAddress, asn1_rs::error::Error, <kerberos_parser::krb5::HostAddress as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 100 | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 100 | where | 55 | 100 | I: Clone + InputLength, | 56 | 100 | F: Parser<I, O, E>, | 57 | 100 | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 100 | } |
nom::multi::many0::<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::complete<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, nom::combinator::cut<&[u8], kerberos_parser::krb5::PAData, asn1_rs::error::Error, <kerberos_parser::krb5::PAData as asn1_rs::traits::FromDer>::from_der>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 2.75k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.75k | where | 55 | 2.75k | I: Clone + InputLength, | 56 | 2.75k | F: Parser<I, O, E>, | 57 | 2.75k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.75k | } |
nom::multi::many0::<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::complete<&[u8], alloc::string::String, asn1_rs::error::Error, nom::combinator::cut<&[u8], alloc::string::String, asn1_rs::error::Error, kerberos_parser::krb5_parser::parse_kerberos_string>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 7.93k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 7.93k | where | 55 | 7.93k | I: Clone + InputLength, | 56 | 7.93k | F: Parser<I, O, E>, | 57 | 7.93k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 7.93k | } |
Unexecuted instantiation: nom::multi::many0::<_, _, _, _> nom::multi::many0::<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::AccessDescription, asn1_rs::error::Error, x509_parser::extensions::parser::parse_authorityinfoaccess::parse_aia>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 2.37k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.37k | where | 55 | 2.37k | I: Clone + InputLength, | 56 | 2.37k | F: Parser<I, O, E>, | 57 | 2.37k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.37k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::PolicyInformation, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_information>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 1.78k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 1.78k | where | 55 | 1.78k | I: Clone + InputLength, | 56 | 1.78k | F: Parser<I, O, E>, | 57 | 1.78k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 1.78k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::CRLDistributionPoint, asn1_rs::error::Error, x509_parser::extensions::parser::parse_crldistributionpoint>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 2.39k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.39k | where | 55 | 2.39k | I: Clone + InputLength, | 56 | 2.39k | F: Parser<I, O, E>, | 57 | 2.39k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.39k | } |
nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}>Line | Count | Source | 53 | 2.21k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.21k | where | 55 | 2.21k | I: Clone + InputLength, | 56 | 2.21k | F: Parser<I, O, E>, | 57 | 2.21k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.21k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, x509_parser::extensions::X509ExtensionParser>::{closure#0}>nom::multi::many0::<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::X509Extension, x509_parser::error::X509Error, <x509_parser::extensions::X509Extension as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Line | Count | Source | 53 | 2.74k | pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 54 | 2.74k | where | 55 | 2.74k | I: Clone + InputLength, | 56 | 2.74k | F: Parser<I, O, E>, | 57 | 2.74k | E: ParseError<I>, | 58 | | { | 59 | | move |mut i: I| { | 60 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 61 | | loop { | 62 | | let len = i.input_len(); | 63 | | match f.parse(i.clone()) { | 64 | | Err(Err::Error(_)) => return Ok((i, acc)), | 65 | | Err(e) => return Err(e), | 66 | | Ok((i1, o)) => { | 67 | | // infinite loop check: the parser must always consume | 68 | | if i1.input_len() == len { | 69 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0))); | 70 | | } | 71 | | | 72 | | i = i1; | 73 | | acc.push(o); | 74 | | } | 75 | | } | 76 | | } | 77 | | } | 78 | 2.74k | } |
Unexecuted instantiation: nom::multi::many0::<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, nom::combinator::cut<&[u8], x509_parser::extensions::generalname::GeneralName, x509_parser::error::X509Error, <x509_parser::extensions::generalname::GeneralName as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}> |
79 | | |
80 | | /// Runs the embedded parser, gathering the results in a `Vec`. |
81 | | /// |
82 | | /// This stops on [`Err::Error`] if there is at least one result, and returns the results that were accumulated. To instead chain an error up, |
83 | | /// see [`cut`][crate::combinator::cut]. |
84 | | /// |
85 | | /// # Arguments |
86 | | /// * `f` The parser to apply. |
87 | | /// |
88 | | /// *Note*: If the parser passed to `many1` accepts empty inputs |
89 | | /// (like `alpha0` or `digit0`), `many1` will return an error, |
90 | | /// to prevent going into an infinite loop. |
91 | | /// |
92 | | /// ```rust |
93 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
94 | | /// use nom::multi::many1; |
95 | | /// use nom::bytes::complete::tag; |
96 | | /// |
97 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
98 | | /// many1(tag("abc"))(s) |
99 | | /// } |
100 | | /// |
101 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
102 | | /// assert_eq!(parser("abc123"), Ok(("123", vec!["abc"]))); |
103 | | /// assert_eq!(parser("123123"), Err(Err::Error(Error::new("123123", ErrorKind::Tag)))); |
104 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Tag)))); |
105 | | /// ``` |
106 | | #[cfg(feature = "alloc")] |
107 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
108 | 103k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
109 | 103k | where |
110 | 103k | I: Clone + InputLength, |
111 | 103k | F: Parser<I, O, E>, |
112 | 103k | E: ParseError<I>, |
113 | | { |
114 | 108k | move |mut i: I| match f.parse(i.clone()) { |
115 | 4.73k | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), |
116 | 216 | Err(e) => Err(e), |
117 | 103k | Ok((i1, o)) => { |
118 | 103k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); |
119 | 103k | acc.push(o); |
120 | 103k | i = i1; |
121 | | |
122 | | loop { |
123 | 2.79M | let len = i.input_len(); |
124 | 2.79M | match f.parse(i.clone()) { |
125 | 99.1k | Err(Err::Error(_)) => return Ok((i, acc)), |
126 | 4.68k | Err(e) => return Err(e), |
127 | 2.69M | Ok((i1, o)) => { |
128 | | // infinite loop check: the parser must always consume |
129 | 2.69M | if i1.input_len() == len { |
130 | 2 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); |
131 | 2.69M | } |
132 | | |
133 | 2.69M | i = i1; |
134 | 2.69M | acc.push(o); |
135 | | } |
136 | | } |
137 | | } |
138 | | } |
139 | 108k | } nom::multi::many1::<&[u8], suricata::sdp::parser::TimeDescription, nom::error::Error<&[u8]>, suricata::sdp::parser::parse_time_description>::{closure#0}Line | Count | Source | 114 | 8 | move |mut i: I| match f.parse(i.clone()) { | 115 | 0 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 8 | Ok((i1, o)) => { | 118 | 8 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 8 | acc.push(o); | 120 | 8 | i = i1; | 121 | | | 122 | | loop { | 123 | 8 | let len = i.input_len(); | 124 | 8 | match f.parse(i.clone()) { | 125 | 8 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 8 | } |
nom::multi::many1::<&[u8], &str, nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], &[u8], &str, nom::error::Error<&[u8]>, nom::character::complete::space1<&[u8], nom::error::Error<&[u8]>>, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::bytes::complete::take_while_m_n<suricata::sdp::parser::parse_media_description::{closure#4}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, core::str::converts::from_utf8>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 7 | move |mut i: I| match f.parse(i.clone()) { | 115 | 0 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 7 | Ok((i1, o)) => { | 118 | 7 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 7 | acc.push(o); | 120 | 7 | i = i1; | 121 | | | 122 | | loop { | 123 | 35 | let len = i.input_len(); | 124 | 35 | match f.parse(i.clone()) { | 125 | 7 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 28 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 28 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 28 | } | 132 | | | 133 | 28 | i = i1; | 134 | 28 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 7 | } |
nom::multi::many1::<&str, suricata::websocket::detect::WebSocketFlag, nom::error::Error<&str>, suricata::websocket::detect::parse_flag_list_item>::{closure#0}Line | Count | Source | 114 | 34 | move |mut i: I| match f.parse(i.clone()) { | 115 | 7 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 27 | Ok((i1, o)) => { | 118 | 27 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 27 | acc.push(o); | 120 | 27 | i = i1; | 121 | | | 122 | | loop { | 123 | 27 | let len = i.input_len(); | 124 | 27 | match f.parse(i.clone()) { | 125 | 27 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 34 | } |
nom::multi::many1::<&[u8], suricata::pgsql::parser::PgsqlParameter, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::pgsql_parse_generic_parameter>::{closure#0}Line | Count | Source | 114 | 15.2k | move |mut i: I| match f.parse(i.clone()) { | 115 | 172 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 216 | Err(e) => Err(e), | 117 | 14.8k | Ok((i1, o)) => { | 118 | 14.8k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 14.8k | acc.push(o); | 120 | 14.8k | i = i1; | 121 | | | 122 | | loop { | 123 | 857k | let len = i.input_len(); | 124 | 857k | match f.parse(i.clone()) { | 125 | 10.1k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 4.68k | Err(e) => return Err(e), | 127 | 843k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 843k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 843k | } | 132 | | | 133 | 843k | i = i1; | 134 | 843k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 15.2k | } |
nom::multi::many1::<&[u8], suricata::pgsql::parser::SASLAuthenticationMechanism, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_sasl_mechanism>::{closure#0}Line | Count | Source | 114 | 1.98k | move |mut i: I| match f.parse(i.clone()) { | 115 | 1.98k | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 0 | Ok((i1, o)) => { | 118 | 0 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 0 | acc.push(o); | 120 | 0 | i = i1; | 121 | | | 122 | | loop { | 123 | 0 | let len = i.input_len(); | 124 | 0 | match f.parse(i.clone()) { | 125 | 0 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1.98k | } |
nom::multi::many1::<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, nom::sequence::tuple<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, (suricata::detect::requires::parse_op, suricata::detect::requires::parse_version)>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 13.0k | move |mut i: I| match f.parse(i.clone()) { | 115 | 1.39k | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 11.6k | Ok((i1, o)) => { | 118 | 11.6k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 11.6k | acc.push(o); | 120 | 11.6k | i = i1; | 121 | | | 122 | | loop { | 123 | 19.9k | let len = i.input_len(); | 124 | 19.9k | match f.parse(i.clone()) { | 125 | 11.6k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 8.27k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 8.27k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 8.27k | } | 132 | | | 133 | 8.27k | i = i1; | 134 | 8.27k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 13.0k | } |
nom::multi::many1::<&str, kerberos_parser::krb5_constants::EncryptionType, nom::error::Error<&str>, suricata::krb::detect::detect_parse_encryption_item>::{closure#0}Line | Count | Source | 114 | 867 | move |mut i: I| match f.parse(i.clone()) { | 115 | 252 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 615 | Ok((i1, o)) => { | 118 | 615 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 615 | acc.push(o); | 120 | 615 | i = i1; | 121 | | | 122 | | loop { | 123 | 21.7k | let len = i.input_len(); | 124 | 21.7k | match f.parse(i.clone()) { | 125 | 615 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 21.1k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 21.1k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 21.1k | } | 132 | | | 133 | 21.1k | i = i1; | 134 | 21.1k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 867 | } |
nom::multi::many1::<&[u8], suricata::mqtt::mqtt_message::MQTTSubscribeTopicData, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::mqtt::mqtt_message::MQTTSubscribeTopicData, nom::error::Error<&[u8]>, suricata::mqtt::parser::parse_subscribe_topic>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1.46k | move |mut i: I| match f.parse(i.clone()) { | 115 | 44 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 1.42k | Ok((i1, o)) => { | 118 | 1.42k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 1.42k | acc.push(o); | 120 | 1.42k | i = i1; | 121 | | | 122 | | loop { | 123 | 17.2k | let len = i.input_len(); | 124 | 17.2k | match f.parse(i.clone()) { | 125 | 1.42k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 15.8k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 15.8k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 15.8k | } | 132 | | | 133 | 15.8k | i = i1; | 134 | 15.8k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1.46k | } |
nom::multi::many1::<&str, suricata::mqtt::detect::MqttParsedFlagItem, nom::error::Error<&str>, suricata::mqtt::detect::parse_flag_list_item>::{closure#0}Line | Count | Source | 114 | 854 | move |mut i: I| match f.parse(i.clone()) { | 115 | 124 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 730 | Ok((i1, o)) => { | 118 | 730 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 730 | acc.push(o); | 120 | 730 | i = i1; | 121 | | | 122 | | loop { | 123 | 1.54k | let len = i.input_len(); | 124 | 1.54k | match f.parse(i.clone()) { | 125 | 730 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 815 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 815 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 815 | } | 132 | | | 133 | 815 | i = i1; | 134 | 815 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 854 | } |
nom::multi::many1::<&str, suricata::mqtt::detect::MqttParsedFlagItem, nom::error::Error<&str>, suricata::mqtt::detect::parse_conn_flag_list_item>::{closure#0}Line | Count | Source | 114 | 780 | move |mut i: I| match f.parse(i.clone()) { | 115 | 119 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 661 | Ok((i1, o)) => { | 118 | 661 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 661 | acc.push(o); | 120 | 661 | i = i1; | 121 | | | 122 | | loop { | 123 | 1.88k | let len = i.input_len(); | 124 | 1.88k | match f.parse(i.clone()) { | 125 | 661 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1.22k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1.22k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 1.22k | } | 132 | | | 133 | 1.22k | i = i1; | 134 | 1.22k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 780 | } |
nom::multi::many1::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, suricata::common::nom7::take_until_and_consume<nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 5.53k | move |mut i: I| match f.parse(i.clone()) { | 115 | 141 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 5.39k | Ok((i1, o)) => { | 118 | 5.39k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 5.39k | acc.push(o); | 120 | 5.39k | i = i1; | 121 | | | 122 | | loop { | 123 | 49.9k | let len = i.input_len(); | 124 | 49.9k | match f.parse(i.clone()) { | 125 | 5.39k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 44.5k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 44.5k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 44.5k | } | 132 | | | 133 | 44.5k | i = i1; | 134 | 44.5k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 5.53k | } |
nom::multi::many1::<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, ntp_parser::ntp::parse_ntp_extension>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 918 | move |mut i: I| match f.parse(i.clone()) { | 115 | 48 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 870 | Ok((i1, o)) => { | 118 | 870 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 870 | acc.push(o); | 120 | 870 | i = i1; | 121 | | | 122 | | loop { | 123 | 358k | let len = i.input_len(); | 124 | 358k | match f.parse(i.clone()) { | 125 | 870 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 357k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 357k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 357k | } | 132 | | | 133 | 357k | i = i1; | 134 | 357k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 918 | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_proposal>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 13 | move |mut i: I| match f.parse(i.clone()) { | 115 | 7 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 6 | Ok((i1, o)) => { | 118 | 6 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 6 | acc.push(o); | 120 | 6 | i = i1; | 121 | | | 122 | | loop { | 123 | 6 | let len = i.input_len(); | 124 | 6 | match f.parse(i.clone()) { | 125 | 6 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 13 | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_ts>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 6 | move |mut i: I| match f.parse(i.clone()) { | 115 | 4 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 2 | Ok((i1, o)) => { | 118 | 2 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 2 | acc.push(o); | 120 | 2 | i = i1; | 121 | | | 122 | | loop { | 123 | 2 | let len = i.input_len(); | 124 | 2 | match f.parse(i.clone()) { | 125 | 2 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 6 | } |
nom::multi::many1::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 15 | move |mut i: I| match f.parse(i.clone()) { | 115 | 3 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 12 | Ok((i1, o)) => { | 118 | 12 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 12 | acc.push(o); | 120 | 12 | i = i1; | 121 | | | 122 | | loop { | 123 | 38 | let len = i.input_len(); | 124 | 38 | match f.parse(i.clone()) { | 125 | 12 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 26 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 26 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 26 | } | 132 | | | 133 | 26 | i = i1; | 134 | 26 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 15 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapMessage as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}nom::multi::many1::<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, ldap_parser::filter_parser::filter_from_ber::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 167 | move |mut i: I| match f.parse(i.clone()) { | 115 | 36 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 131 | Ok((i1, o)) => { | 118 | 131 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 131 | acc.push(o); | 120 | 131 | i = i1; | 121 | | | 122 | | loop { | 123 | 207 | let len = i.input_len(); | 124 | 207 | match f.parse(i.clone()) { | 125 | 131 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 76 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 76 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 76 | } | 132 | | | 133 | 76 | i = i1; | 134 | 76 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 167 | } |
nom::multi::many1::<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, <x509_parser::x509::AttributeTypeAndValue as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 8.36k | move |mut i: I| match f.parse(i.clone()) { | 115 | 30 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 8.33k | Ok((i1, o)) => { | 118 | 8.33k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 8.33k | acc.push(o); | 120 | 8.33k | i = i1; | 121 | | | 122 | | loop { | 123 | 8.33k | let len = i.input_len(); | 124 | 8.33k | match f.parse(i.clone()) { | 125 | 8.33k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 8.36k | } |
nom::multi::many1::<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_qualifier_info>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 7 | move |mut i: I| match f.parse(i.clone()) { | 115 | 0 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 7 | Ok((i1, o)) => { | 118 | 7 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 7 | acc.push(o); | 120 | 7 | i = i1; | 121 | | | 122 | | loop { | 123 | 8 | let len = i.input_len(); | 124 | 8 | match f.parse(i.clone()) { | 125 | 7 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 1 | } | 132 | | | 133 | 1 | i = i1; | 134 | 1 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 7 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, x509_parser::extensions::nameconstraints::parse_nameconstraints::parse_subtree>::{closure#0}>::{closure#0}nom::multi::many1::<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, x509_parser::extensions::sct::parse_ct_signed_certificate_timestamp>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 2 | move |mut i: I| match f.parse(i.clone()) { | 115 | 0 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 2 | Ok((i1, o)) => { | 118 | 2 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 2 | acc.push(o); | 120 | 2 | i = i1; | 121 | | | 122 | | loop { | 123 | 7 | let len = i.input_len(); | 124 | 7 | match f.parse(i.clone()) { | 125 | 2 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 5 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 5 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 5 | } | 132 | | | 133 | 5 | i = i1; | 134 | 5 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 2 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_alert>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 414 | move |mut i: I| match f.parse(i.clone()) { | 115 | 3 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 411 | Ok((i1, o)) => { | 118 | 411 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 411 | acc.push(o); | 120 | 411 | i = i1; | 121 | | | 122 | | loop { | 123 | 3.28k | let len = i.input_len(); | 124 | 3.28k | match f.parse(i.clone()) { | 125 | 411 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 2.87k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 2.87k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 2.87k | } | 132 | | | 133 | 2.87k | i = i1; | 134 | 2.87k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 414 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_handshake>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 9.65k | move |mut i: I| match f.parse(i.clone()) { | 115 | 14 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 9.64k | Ok((i1, o)) => { | 118 | 9.64k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 9.64k | acc.push(o); | 120 | 9.64k | i = i1; | 121 | | | 122 | | loop { | 123 | 40.0k | let len = i.input_len(); | 124 | 40.0k | match f.parse(i.clone()) { | 125 | 9.64k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 30.4k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 30.4k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 30.4k | } | 132 | | | 133 | 30.4k | i = i1; | 134 | 30.4k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 9.65k | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_applicationdata>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1 | move |mut i: I| match f.parse(i.clone()) { | 115 | 0 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 1 | Ok((i1, o)) => { | 118 | 1 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 1 | acc.push(o); | 120 | 1 | i = i1; | 121 | | | 122 | | loop { | 123 | 1 | let len = i.input_len(); | 124 | 1 | match f.parse(i.clone()) { | 125 | 0 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1 | if i1.input_len() == len { | 130 | 1 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_changecipherspec>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 78 | move |mut i: I| match f.parse(i.clone()) { | 115 | 2 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 76 | Ok((i1, o)) => { | 118 | 76 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 76 | acc.push(o); | 120 | 76 | i = i1; | 121 | | | 122 | | loop { | 123 | 77 | let len = i.input_len(); | 124 | 77 | match f.parse(i.clone()) { | 125 | 76 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 1 | } | 132 | | | 133 | 1 | i = i1; | 134 | 1 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 78 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_plaintext>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_alert>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_handshake>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_changecipherspec>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_plaintext_record>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<_, _, _, _>::{closure#0}nom::multi::many1::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, ldap_parser::parser::parse_ldap_uri>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 315 | move |mut i: I| match f.parse(i.clone()) { | 115 | 8 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 307 | Ok((i1, o)) => { | 118 | 307 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 307 | acc.push(o); | 120 | 307 | i = i1; | 121 | | | 122 | | loop { | 123 | 489 | let len = i.input_len(); | 124 | 489 | match f.parse(i.clone()) { | 125 | 307 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 182 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 182 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 182 | } | 132 | | | 133 | 182 | i = i1; | 134 | 182 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 315 | } |
nom::multi::many1::<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, <ldap_parser::ldap::Change as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 19 | move |mut i: I| match f.parse(i.clone()) { | 115 | 19 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 0 | Ok((i1, o)) => { | 118 | 0 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 0 | acc.push(o); | 120 | 0 | i = i1; | 121 | | | 122 | | loop { | 123 | 0 | let len = i.input_len(); | 124 | 0 | match f.parse(i.clone()) { | 125 | 0 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 19 | } |
nom::multi::many1::<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_substring>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 16 | move |mut i: I| match f.parse(i.clone()) { | 115 | 4 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 12 | Ok((i1, o)) => { | 118 | 12 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 12 | acc.push(o); | 120 | 12 | i = i1; | 121 | | | 122 | | loop { | 123 | 39 | let len = i.input_len(); | 124 | 39 | match f.parse(i.clone()) { | 125 | 12 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 27 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 27 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 27 | } | 132 | | | 133 | 27 | i = i1; | 134 | 27 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 16 | } |
nom::multi::many1::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 994 | move |mut i: I| match f.parse(i.clone()) { | 115 | 3 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 991 | Ok((i1, o)) => { | 118 | 991 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 991 | acc.push(o); | 120 | 991 | i = i1; | 121 | | | 122 | | loop { | 123 | 991 | let len = i.input_len(); | 124 | 991 | match f.parse(i.clone()) { | 125 | 991 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 994 | } |
nom::multi::many1::<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, ntp_parser::ntp::parse_ntp_extension>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 3.02k | move |mut i: I| match f.parse(i.clone()) { | 115 | 43 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 2.98k | Ok((i1, o)) => { | 118 | 2.98k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 2.98k | acc.push(o); | 120 | 2.98k | i = i1; | 121 | | | 122 | | loop { | 123 | 1.35M | let len = i.input_len(); | 124 | 1.35M | match f.parse(i.clone()) { | 125 | 2.98k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1.35M | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1.35M | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 1.35M | } | 132 | | | 133 | 1.35M | i = i1; | 134 | 1.35M | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 3.02k | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_proposal>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 14 | move |mut i: I| match f.parse(i.clone()) { | 115 | 4 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 10 | Ok((i1, o)) => { | 118 | 10 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 10 | acc.push(o); | 120 | 10 | i = i1; | 121 | | | 122 | | loop { | 123 | 10 | let len = i.input_len(); | 124 | 10 | match f.parse(i.clone()) { | 125 | 10 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 14 | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_ts>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1 | move |mut i: I| match f.parse(i.clone()) { | 115 | 1 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 0 | Ok((i1, o)) => { | 118 | 0 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 0 | acc.push(o); | 120 | 0 | i = i1; | 121 | | | 122 | | loop { | 123 | 0 | let len = i.input_len(); | 124 | 0 | match f.parse(i.clone()) { | 125 | 0 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1 | } |
nom::multi::many1::<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, <x509_parser::x509::AttributeTypeAndValue as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 27.8k | move |mut i: I| match f.parse(i.clone()) { | 115 | 133 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 27.7k | Ok((i1, o)) => { | 118 | 27.7k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 27.7k | acc.push(o); | 120 | 27.7k | i = i1; | 121 | | | 122 | | loop { | 123 | 27.7k | let len = i.input_len(); | 124 | 27.7k | match f.parse(i.clone()) { | 125 | 27.7k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 27.8k | } |
nom::multi::many1::<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_qualifier_info>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1.63k | move |mut i: I| match f.parse(i.clone()) { | 115 | 4 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 1.63k | Ok((i1, o)) => { | 118 | 1.63k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 1.63k | acc.push(o); | 120 | 1.63k | i = i1; | 121 | | | 122 | | loop { | 123 | 2.45k | let len = i.input_len(); | 124 | 2.45k | match f.parse(i.clone()) { | 125 | 1.63k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 828 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 828 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 828 | } | 132 | | | 133 | 828 | i = i1; | 134 | 828 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1.63k | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, x509_parser::extensions::nameconstraints::parse_nameconstraints::parse_subtree>::{closure#0}>::{closure#0}nom::multi::many1::<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, x509_parser::extensions::sct::parse_ct_signed_certificate_timestamp>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1.00k | move |mut i: I| match f.parse(i.clone()) { | 115 | 1 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 1.00k | Ok((i1, o)) => { | 118 | 1.00k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 1.00k | acc.push(o); | 120 | 1.00k | i = i1; | 121 | | | 122 | | loop { | 123 | 2.98k | let len = i.input_len(); | 124 | 2.98k | match f.parse(i.clone()) { | 125 | 1.00k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1.97k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1.97k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 1.97k | } | 132 | | | 133 | 1.97k | i = i1; | 134 | 1.97k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1.00k | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_alert>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 873 | move |mut i: I| match f.parse(i.clone()) { | 115 | 3 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 870 | Ok((i1, o)) => { | 118 | 870 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 870 | acc.push(o); | 120 | 870 | i = i1; | 121 | | | 122 | | loop { | 123 | 7.31k | let len = i.input_len(); | 124 | 7.31k | match f.parse(i.clone()) { | 125 | 870 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 6.44k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 6.44k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 6.44k | } | 132 | | | 133 | 6.44k | i = i1; | 134 | 6.44k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 873 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_handshake>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1.78k | move |mut i: I| match f.parse(i.clone()) { | 115 | 11 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 1.77k | Ok((i1, o)) => { | 118 | 1.77k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 1.77k | acc.push(o); | 120 | 1.77k | i = i1; | 121 | | | 122 | | loop { | 123 | 5.10k | let len = i.input_len(); | 124 | 5.10k | match f.parse(i.clone()) { | 125 | 1.77k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 3.33k | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 3.33k | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 3.33k | } | 132 | | | 133 | 3.33k | i = i1; | 134 | 3.33k | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1.78k | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_applicationdata>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 1 | move |mut i: I| match f.parse(i.clone()) { | 115 | 0 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 1 | Ok((i1, o)) => { | 118 | 1 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 1 | acc.push(o); | 120 | 1 | i = i1; | 121 | | | 122 | | loop { | 123 | 1 | let len = i.input_len(); | 124 | 1 | match f.parse(i.clone()) { | 125 | 0 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 1 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 1 | if i1.input_len() == len { | 130 | 1 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 1 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_changecipherspec>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 84 | move |mut i: I| match f.parse(i.clone()) { | 115 | 1 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 83 | Ok((i1, o)) => { | 118 | 83 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 83 | acc.push(o); | 120 | 83 | i = i1; | 121 | | | 122 | | loop { | 123 | 83 | let len = i.input_len(); | 124 | 83 | match f.parse(i.clone()) { | 125 | 83 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 0 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 0 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 0 | } | 132 | | | 133 | 0 | i = i1; | 134 | 0 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 84 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_plaintext>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_alert>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_handshake>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_changecipherspec>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_plaintext_record>::{closure#0}>::{closure#0}nom::multi::many1::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 70 | move |mut i: I| match f.parse(i.clone()) { | 115 | 5 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 65 | Ok((i1, o)) => { | 118 | 65 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 65 | acc.push(o); | 120 | 65 | i = i1; | 121 | | | 122 | | loop { | 123 | 130 | let len = i.input_len(); | 124 | 130 | match f.parse(i.clone()) { | 125 | 65 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 65 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 65 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 65 | } | 132 | | | 133 | 65 | i = i1; | 134 | 65 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 70 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapMessage as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}nom::multi::many1::<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, ldap_parser::filter_parser::filter_from_ber::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 413 | move |mut i: I| match f.parse(i.clone()) { | 115 | 60 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 353 | Ok((i1, o)) => { | 118 | 353 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 353 | acc.push(o); | 120 | 353 | i = i1; | 121 | | | 122 | | loop { | 123 | 757 | let len = i.input_len(); | 124 | 757 | match f.parse(i.clone()) { | 125 | 353 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 404 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 404 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 404 | } | 132 | | | 133 | 404 | i = i1; | 134 | 404 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 413 | } |
Unexecuted instantiation: nom::multi::many1::<_, _, _, _>::{closure#0}nom::multi::many1::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 3.02k | move |mut i: I| match f.parse(i.clone()) { | 115 | 11 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 3.01k | Ok((i1, o)) => { | 118 | 3.01k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 3.01k | acc.push(o); | 120 | 3.01k | i = i1; | 121 | | | 122 | | loop { | 123 | 3.06k | let len = i.input_len(); | 124 | 3.06k | match f.parse(i.clone()) { | 125 | 3.01k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 48 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 48 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 48 | } | 132 | | | 133 | 48 | i = i1; | 134 | 48 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 3.02k | } |
nom::multi::many1::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, ldap_parser::parser::parse_ldap_uri>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 8.06k | move |mut i: I| match f.parse(i.clone()) { | 115 | 14 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 8.05k | Ok((i1, o)) => { | 118 | 8.05k | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 8.05k | acc.push(o); | 120 | 8.05k | i = i1; | 121 | | | 122 | | loop { | 123 | 8.18k | let len = i.input_len(); | 124 | 8.18k | match f.parse(i.clone()) { | 125 | 8.05k | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 132 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 132 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 132 | } | 132 | | | 133 | 132 | i = i1; | 134 | 132 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 8.06k | } |
nom::multi::many1::<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, <ldap_parser::ldap::Change as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 52 | move |mut i: I| match f.parse(i.clone()) { | 115 | 24 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 28 | Ok((i1, o)) => { | 118 | 28 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 28 | acc.push(o); | 120 | 28 | i = i1; | 121 | | | 122 | | loop { | 123 | 61 | let len = i.input_len(); | 124 | 61 | match f.parse(i.clone()) { | 125 | 28 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 33 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 33 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 33 | } | 132 | | | 133 | 33 | i = i1; | 134 | 33 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 52 | } |
nom::multi::many1::<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_substring>::{closure#0}>::{closure#0}Line | Count | Source | 114 | 25 | move |mut i: I| match f.parse(i.clone()) { | 115 | 4 | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | 0 | Err(e) => Err(e), | 117 | 21 | Ok((i1, o)) => { | 118 | 21 | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | 21 | acc.push(o); | 120 | 21 | i = i1; | 121 | | | 122 | | loop { | 123 | 81 | let len = i.input_len(); | 124 | 81 | match f.parse(i.clone()) { | 125 | 21 | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | 0 | Err(e) => return Err(e), | 127 | 60 | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | 60 | if i1.input_len() == len { | 130 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | 60 | } | 132 | | | 133 | 60 | i = i1; | 134 | 60 | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | 25 | } |
|
140 | 103k | } nom::multi::many1::<&[u8], suricata::sdp::parser::TimeDescription, nom::error::Error<&[u8]>, suricata::sdp::parser::parse_time_description> Line | Count | Source | 108 | 8 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 8 | where | 110 | 8 | I: Clone + InputLength, | 111 | 8 | F: Parser<I, O, E>, | 112 | 8 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 8 | } |
nom::multi::many1::<&[u8], &str, nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], &[u8], &str, nom::error::Error<&[u8]>, nom::character::complete::space1<&[u8], nom::error::Error<&[u8]>>, nom::combinator::map_res<&[u8], &[u8], &str, nom::error::Error<&[u8]>, core::str::error::Utf8Error, nom::bytes::complete::take_while_m_n<suricata::sdp::parser::parse_media_description::{closure#4}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, core::str::converts::from_utf8>::{closure#0}>::{closure#0}>Line | Count | Source | 108 | 7 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 7 | where | 110 | 7 | I: Clone + InputLength, | 111 | 7 | F: Parser<I, O, E>, | 112 | 7 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 7 | } |
nom::multi::many1::<&str, suricata::websocket::detect::WebSocketFlag, nom::error::Error<&str>, suricata::websocket::detect::parse_flag_list_item> Line | Count | Source | 108 | 34 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 34 | where | 110 | 34 | I: Clone + InputLength, | 111 | 34 | F: Parser<I, O, E>, | 112 | 34 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 34 | } |
nom::multi::many1::<&[u8], suricata::pgsql::parser::PgsqlParameter, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::pgsql_parse_generic_parameter> Line | Count | Source | 108 | 15.2k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 15.2k | where | 110 | 15.2k | I: Clone + InputLength, | 111 | 15.2k | F: Parser<I, O, E>, | 112 | 15.2k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 15.2k | } |
nom::multi::many1::<&[u8], suricata::pgsql::parser::SASLAuthenticationMechanism, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_sasl_mechanism> Line | Count | Source | 108 | 1.98k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1.98k | where | 110 | 1.98k | I: Clone + InputLength, | 111 | 1.98k | F: Parser<I, O, E>, | 112 | 1.98k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1.98k | } |
nom::multi::many1::<&str, kerberos_parser::krb5_constants::EncryptionType, nom::error::Error<&str>, suricata::krb::detect::detect_parse_encryption_item> Line | Count | Source | 108 | 867 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 867 | where | 110 | 867 | I: Clone + InputLength, | 111 | 867 | F: Parser<I, O, E>, | 112 | 867 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 867 | } |
nom::multi::many1::<&[u8], suricata::mqtt::mqtt_message::MQTTSubscribeTopicData, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::mqtt::mqtt_message::MQTTSubscribeTopicData, nom::error::Error<&[u8]>, suricata::mqtt::parser::parse_subscribe_topic>::{closure#0}>Line | Count | Source | 108 | 1.46k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1.46k | where | 110 | 1.46k | I: Clone + InputLength, | 111 | 1.46k | F: Parser<I, O, E>, | 112 | 1.46k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1.46k | } |
nom::multi::many1::<&str, suricata::mqtt::detect::MqttParsedFlagItem, nom::error::Error<&str>, suricata::mqtt::detect::parse_flag_list_item> Line | Count | Source | 108 | 854 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 854 | where | 110 | 854 | I: Clone + InputLength, | 111 | 854 | F: Parser<I, O, E>, | 112 | 854 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 854 | } |
nom::multi::many1::<&str, suricata::mqtt::detect::MqttParsedFlagItem, nom::error::Error<&str>, suricata::mqtt::detect::parse_conn_flag_list_item> Line | Count | Source | 108 | 780 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 780 | where | 110 | 780 | I: Clone + InputLength, | 111 | 780 | F: Parser<I, O, E>, | 112 | 780 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 780 | } |
nom::multi::many1::<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, nom::sequence::tuple<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, (suricata::detect::requires::parse_op, suricata::detect::requires::parse_version)>::{closure#0}>Line | Count | Source | 108 | 7.43k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 7.43k | where | 110 | 7.43k | I: Clone + InputLength, | 111 | 7.43k | F: Parser<I, O, E>, | 112 | 7.43k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 7.43k | } |
nom::multi::many1::<&[u8], &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], &[u8], nom::error::Error<&[u8]>, suricata::common::nom7::take_until_and_consume<nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}>Line | Count | Source | 108 | 5.53k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 5.53k | where | 110 | 5.53k | I: Clone + InputLength, | 111 | 5.53k | F: Parser<I, O, E>, | 112 | 5.53k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 5.53k | } |
nom::multi::many1::<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, ntp_parser::ntp::parse_ntp_extension>::{closure#0}>Line | Count | Source | 108 | 918 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 918 | where | 110 | 918 | I: Clone + InputLength, | 111 | 918 | F: Parser<I, O, E>, | 112 | 918 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 918 | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_proposal>::{closure#0}>Line | Count | Source | 108 | 13 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 13 | where | 110 | 13 | I: Clone + InputLength, | 111 | 13 | F: Parser<I, O, E>, | 112 | 13 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 13 | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_ts>::{closure#0}>Line | Count | Source | 108 | 6 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 6 | where | 110 | 6 | I: Clone + InputLength, | 111 | 6 | F: Parser<I, O, E>, | 112 | 6 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 6 | } |
nom::multi::many1::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>Line | Count | Source | 108 | 15 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 15 | where | 110 | 15 | I: Clone + InputLength, | 111 | 15 | F: Parser<I, O, E>, | 112 | 15 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 15 | } |
nom::multi::many1::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, ldap_parser::parser::parse_ldap_uri>::{closure#0}>Line | Count | Source | 108 | 392 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 392 | where | 110 | 392 | I: Clone + InputLength, | 111 | 392 | F: Parser<I, O, E>, | 112 | 392 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 392 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapMessage as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>nom::multi::many1::<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, ldap_parser::filter_parser::filter_from_ber::{closure#0}>::{closure#0}>Line | Count | Source | 108 | 167 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 167 | where | 110 | 167 | I: Clone + InputLength, | 111 | 167 | F: Parser<I, O, E>, | 112 | 167 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 167 | } |
nom::multi::many1::<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, <x509_parser::x509::AttributeTypeAndValue as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Line | Count | Source | 108 | 8.36k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 8.36k | where | 110 | 8.36k | I: Clone + InputLength, | 111 | 8.36k | F: Parser<I, O, E>, | 112 | 8.36k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 8.36k | } |
nom::multi::many1::<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_qualifier_info>::{closure#0}>Line | Count | Source | 108 | 7 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 7 | where | 110 | 7 | I: Clone + InputLength, | 111 | 7 | F: Parser<I, O, E>, | 112 | 7 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 7 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, x509_parser::extensions::nameconstraints::parse_nameconstraints::parse_subtree>::{closure#0}>nom::multi::many1::<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, x509_parser::extensions::sct::parse_ct_signed_certificate_timestamp>::{closure#0}>Line | Count | Source | 108 | 2 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 2 | where | 110 | 2 | I: Clone + InputLength, | 111 | 2 | F: Parser<I, O, E>, | 112 | 2 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 2 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_alert>::{closure#0}>Line | Count | Source | 108 | 414 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 414 | where | 110 | 414 | I: Clone + InputLength, | 111 | 414 | F: Parser<I, O, E>, | 112 | 414 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 414 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_handshake>::{closure#0}>Line | Count | Source | 108 | 9.65k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 9.65k | where | 110 | 9.65k | I: Clone + InputLength, | 111 | 9.65k | F: Parser<I, O, E>, | 112 | 9.65k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 9.65k | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_applicationdata>::{closure#0}>Line | Count | Source | 108 | 1 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1 | where | 110 | 1 | I: Clone + InputLength, | 111 | 1 | F: Parser<I, O, E>, | 112 | 1 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_changecipherspec>::{closure#0}>Line | Count | Source | 108 | 78 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 78 | where | 110 | 78 | I: Clone + InputLength, | 111 | 78 | F: Parser<I, O, E>, | 112 | 78 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 78 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_plaintext>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_alert>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_handshake>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_changecipherspec>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_plaintext_record>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<_, _, _, _> nom::multi::many1::<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, <ldap_parser::ldap::Change as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 108 | 43 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 43 | where | 110 | 43 | I: Clone + InputLength, | 111 | 43 | F: Parser<I, O, E>, | 112 | 43 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 43 | } |
nom::multi::many1::<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_substring>::{closure#0}>Line | Count | Source | 108 | 16 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 16 | where | 110 | 16 | I: Clone + InputLength, | 111 | 16 | F: Parser<I, O, E>, | 112 | 16 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 16 | } |
nom::multi::many1::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>Line | Count | Source | 108 | 994 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 994 | where | 110 | 994 | I: Clone + InputLength, | 111 | 994 | F: Parser<I, O, E>, | 112 | 994 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 994 | } |
nom::multi::many1::<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ntp_parser::ntp::NtpExtension, nom::error::Error<&[u8]>, ntp_parser::ntp::parse_ntp_extension>::{closure#0}>Line | Count | Source | 108 | 3.02k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 3.02k | where | 110 | 3.02k | I: Clone + InputLength, | 111 | 3.02k | F: Parser<I, O, E>, | 112 | 3.02k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 3.02k | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::IkeV2Proposal, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_proposal>::{closure#0}>Line | Count | Source | 108 | 14 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 14 | where | 110 | 14 | I: Clone + InputLength, | 111 | 14 | F: Parser<I, O, E>, | 112 | 14 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 14 | } |
nom::multi::many1::<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], ipsec_parser::ikev2::TrafficSelector, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_ts>::{closure#0}>Line | Count | Source | 108 | 1 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1 | where | 110 | 1 | I: Clone + InputLength, | 111 | 1 | F: Parser<I, O, E>, | 112 | 1 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1 | } |
nom::multi::many1::<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, nom::combinator::complete<&[u8], x509_parser::x509::AttributeTypeAndValue, x509_parser::error::X509Error, <x509_parser::x509::AttributeTypeAndValue as asn1_rs::traits::FromDer<x509_parser::error::X509Error>>::from_der>::{closure#0}>Line | Count | Source | 108 | 27.8k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 27.8k | where | 110 | 27.8k | I: Clone + InputLength, | 111 | 27.8k | F: Parser<I, O, E>, | 112 | 27.8k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 27.8k | } |
nom::multi::many1::<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::PolicyQualifierInfo, asn1_rs::error::Error, x509_parser::extensions::parser::parse_certificatepolicies::parse_policy_qualifier_info>::{closure#0}>Line | Count | Source | 108 | 1.63k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1.63k | where | 110 | 1.63k | I: Clone + InputLength, | 111 | 1.63k | F: Parser<I, O, E>, | 112 | 1.63k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1.63k | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::nameconstraints::GeneralSubtree, asn1_rs::error::Error, x509_parser::extensions::nameconstraints::parse_nameconstraints::parse_subtree>::{closure#0}>nom::multi::many1::<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::sct::SignedCertificateTimestamp, asn1_rs::error::Error, x509_parser::extensions::sct::parse_ct_signed_certificate_timestamp>::{closure#0}>Line | Count | Source | 108 | 1.00k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1.00k | where | 110 | 1.00k | I: Clone + InputLength, | 111 | 1.00k | F: Parser<I, O, E>, | 112 | 1.00k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1.00k | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_alert>::{closure#0}>Line | Count | Source | 108 | 873 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 873 | where | 110 | 873 | I: Clone + InputLength, | 111 | 873 | F: Parser<I, O, E>, | 112 | 873 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 873 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_handshake>::{closure#0}>Line | Count | Source | 108 | 1.78k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1.78k | where | 110 | 1.78k | I: Clone + InputLength, | 111 | 1.78k | F: Parser<I, O, E>, | 112 | 1.78k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1.78k | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_applicationdata>::{closure#0}>Line | Count | Source | 108 | 1 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 1 | where | 110 | 1 | I: Clone + InputLength, | 111 | 1 | F: Parser<I, O, E>, | 112 | 1 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 1 | } |
nom::multi::many1::<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsMessage, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_message_changecipherspec>::{closure#0}>Line | Count | Source | 108 | 84 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 84 | where | 110 | 84 | I: Clone + InputLength, | 111 | 84 | F: Parser<I, O, E>, | 112 | 84 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 84 | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::tls::TlsPlaintext, nom::error::Error<&[u8]>, tls_parser::tls::parse_tls_plaintext>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_alert>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_handshake>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSMessage, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_message_changecipherspec>::{closure#0}>Unexecuted instantiation: nom::multi::many1::<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], tls_parser::dtls::DTLSPlaintext, nom::error::Error<&[u8]>, tls_parser::dtls::parse_dtls_plaintext_record>::{closure#0}>nom::multi::many1::<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::AttributeValue, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_attribute_value>::{closure#0}>Line | Count | Source | 108 | 70 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 70 | where | 110 | 70 | I: Clone + InputLength, | 111 | 70 | F: Parser<I, O, E>, | 112 | 70 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 70 | } |
nom::multi::many1::<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapString, ldap_parser::error::LdapError, ldap_parser::parser::parse_ldap_uri>::{closure#0}>Line | Count | Source | 108 | 8.61k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 8.61k | where | 110 | 8.61k | I: Clone + InputLength, | 111 | 8.61k | F: Parser<I, O, E>, | 112 | 8.61k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 8.61k | } |
Unexecuted instantiation: nom::multi::many1::<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::LdapMessage, ldap_parser::error::LdapError, <ldap_parser::ldap::LdapMessage as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>nom::multi::many1::<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Filter, ldap_parser::error::LdapError, ldap_parser::filter_parser::filter_from_ber::{closure#0}>::{closure#0}>Line | Count | Source | 108 | 413 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 413 | where | 110 | 413 | I: Clone + InputLength, | 111 | 413 | F: Parser<I, O, E>, | 112 | 413 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 413 | } |
Unexecuted instantiation: nom::multi::many1::<_, _, _, _> nom::multi::many1::<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, nom::combinator::complete<&[u8], x509_parser::extensions::generalname::GeneralName, asn1_rs::error::Error, x509_parser::extensions::generalname::parse_generalname>::{closure#0}>Line | Count | Source | 108 | 3.02k | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 3.02k | where | 110 | 3.02k | I: Clone + InputLength, | 111 | 3.02k | F: Parser<I, O, E>, | 112 | 3.02k | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 3.02k | } |
nom::multi::many1::<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::ldap::Change, ldap_parser::error::LdapError, <ldap_parser::ldap::Change as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>Line | Count | Source | 108 | 158 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 158 | where | 110 | 158 | I: Clone + InputLength, | 111 | 158 | F: Parser<I, O, E>, | 112 | 158 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 158 | } |
nom::multi::many1::<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, nom::combinator::complete<&[u8], ldap_parser::filter::Substring, ldap_parser::error::LdapError, ldap_parser::filter_parser::parse_ldap_substring>::{closure#0}>Line | Count | Source | 108 | 25 | pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 109 | 25 | where | 110 | 25 | I: Clone + InputLength, | 111 | 25 | F: Parser<I, O, E>, | 112 | 25 | E: ParseError<I>, | 113 | | { | 114 | | move |mut i: I| match f.parse(i.clone()) { | 115 | | Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))), | 116 | | Err(e) => Err(e), | 117 | | Ok((i1, o)) => { | 118 | | let mut acc = crate::lib::std::vec::Vec::with_capacity(4); | 119 | | acc.push(o); | 120 | | i = i1; | 121 | | | 122 | | loop { | 123 | | let len = i.input_len(); | 124 | | match f.parse(i.clone()) { | 125 | | Err(Err::Error(_)) => return Ok((i, acc)), | 126 | | Err(e) => return Err(e), | 127 | | Ok((i1, o)) => { | 128 | | // infinite loop check: the parser must always consume | 129 | | if i1.input_len() == len { | 130 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))); | 131 | | } | 132 | | | 133 | | i = i1; | 134 | | acc.push(o); | 135 | | } | 136 | | } | 137 | | } | 138 | | } | 139 | | } | 140 | 25 | } |
|
141 | | |
142 | | /// Applies the parser `f` until the parser `g` produces a result. |
143 | | /// |
144 | | /// Returns a tuple of the results of `f` in a `Vec` and the result of `g`. |
145 | | /// |
146 | | /// `f` keeps going so long as `g` produces [`Err::Error`]. To instead chain an error up, see [`cut`][crate::combinator::cut]. |
147 | | /// |
148 | | /// ```rust |
149 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
150 | | /// use nom::multi::many_till; |
151 | | /// use nom::bytes::complete::tag; |
152 | | /// |
153 | | /// fn parser(s: &str) -> IResult<&str, (Vec<&str>, &str)> { |
154 | | /// many_till(tag("abc"), tag("end"))(s) |
155 | | /// }; |
156 | | /// |
157 | | /// assert_eq!(parser("abcabcend"), Ok(("", (vec!["abc", "abc"], "end")))); |
158 | | /// assert_eq!(parser("abc123end"), Err(Err::Error(Error::new("123end", ErrorKind::Tag)))); |
159 | | /// assert_eq!(parser("123123end"), Err(Err::Error(Error::new("123123end", ErrorKind::Tag)))); |
160 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Tag)))); |
161 | | /// assert_eq!(parser("abcendefg"), Ok(("efg", (vec!["abc"], "end")))); |
162 | | /// ``` |
163 | | #[cfg(feature = "alloc")] |
164 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
165 | 34.1k | pub fn many_till<I, O, P, E, F, G>( |
166 | 34.1k | mut f: F, |
167 | 34.1k | mut g: G, |
168 | 34.1k | ) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E> |
169 | 34.1k | where |
170 | 34.1k | I: Clone + InputLength, |
171 | 34.1k | F: Parser<I, O, E>, |
172 | 34.1k | G: Parser<I, P, E>, |
173 | 34.1k | E: ParseError<I>, |
174 | | { |
175 | 34.1k | move |mut i: I| { |
176 | 34.1k | let mut res = crate::lib::std::vec::Vec::new(); |
177 | | loop { |
178 | 7.43M | let len = i.input_len(); |
179 | 7.43M | match g.parse(i.clone()) { |
180 | 5.58k | Ok((i1, o)) => return Ok((i1, (res, o))), |
181 | | Err(Err::Error(_)) => { |
182 | 7.42M | match f.parse(i.clone()) { |
183 | 6.82k | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), |
184 | 20.9k | Err(e) => return Err(e), |
185 | 7.39M | Ok((i1, o)) => { |
186 | | // infinite loop check: the parser must always consume |
187 | 7.39M | if i1.input_len() == len { |
188 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); |
189 | 7.39M | } |
190 | | |
191 | 7.39M | res.push(o); |
192 | 7.39M | i = i1; |
193 | | } |
194 | | } |
195 | | } |
196 | 781 | Err(e) => return Err(e), |
197 | | } |
198 | | } |
199 | 34.1k | } nom::multi::many_till::<&[u8], suricata::pgsql::parser::PgsqlErrorNoticeMessageField, &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_error_notice_fields::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>::{closure#0}>::{closure#0}Line | Count | Source | 175 | 32.2k | move |mut i: I| { | 176 | 32.2k | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | 413k | let len = i.input_len(); | 179 | 413k | match g.parse(i.clone()) { | 180 | 4.80k | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | 408k | match f.parse(i.clone()) { | 183 | 5.65k | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | 20.9k | Err(e) => return Err(e), | 185 | 381k | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | 381k | if i1.input_len() == len { | 188 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | 381k | } | 190 | | | 191 | 381k | res.push(o); | 192 | 381k | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | 781 | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | 32.2k | } |
nom::multi::many_till::<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_readdir_entry>::{closure#0}, nom::combinator::peek<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::tag<&[u8; 4], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 175 | 8 | move |mut i: I| { | 176 | 8 | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | 10 | let len = i.input_len(); | 179 | 10 | match g.parse(i.clone()) { | 180 | 2 | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | 8 | match f.parse(i.clone()) { | 183 | 6 | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | 0 | Err(e) => return Err(e), | 185 | 2 | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | 2 | if i1.input_len() == len { | 188 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | 2 | } | 190 | | | 191 | 2 | res.push(o); | 192 | 2 | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | 0 | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | 8 | } |
Unexecuted instantiation: nom::multi::many_till::<_, _, _, _, _, _>::{closure#0}nom::multi::many_till::<&[u8], &[u8], (char, &[u8]), nom::error::Error<&[u8]>, nom::sequence::terminated<&[u8], &[u8], &[u8], nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], core::option::Option<char>, &[u8], nom::error::Error<&[u8]>, nom::combinator::opt<&[u8], char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::bytes::complete::take_until<&[u8], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, nom::sequence::pair<&[u8], char, &[u8], nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}Line | Count | Source | 175 | 286 | move |mut i: I| { | 176 | 286 | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | 2.64M | let len = i.input_len(); | 179 | 2.64M | match g.parse(i.clone()) { | 180 | 103 | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | 2.64M | match f.parse(i.clone()) { | 183 | 183 | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | 0 | Err(e) => return Err(e), | 185 | 2.64M | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | 2.64M | if i1.input_len() == len { | 188 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | 2.64M | } | 190 | | | 191 | 2.64M | res.push(o); | 192 | 2.64M | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | 0 | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | 286 | } |
Unexecuted instantiation: nom::multi::many_till::<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_readdir_entry>::{closure#0}, nom::combinator::peek<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::tag<&[u8; 4], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}>::{closure#0}Unexecuted instantiation: nom::multi::many_till::<_, _, _, _, _, _>::{closure#0}nom::multi::many_till::<&[u8], &[u8], (char, &[u8]), nom::error::Error<&[u8]>, nom::sequence::terminated<&[u8], &[u8], &[u8], nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], core::option::Option<char>, &[u8], nom::error::Error<&[u8]>, nom::combinator::opt<&[u8], char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::bytes::complete::take_until<&[u8], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, nom::sequence::pair<&[u8], char, &[u8], nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>::{closure#0}Line | Count | Source | 175 | 1.65k | move |mut i: I| { | 176 | 1.65k | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | 4.37M | let len = i.input_len(); | 179 | 4.37M | match g.parse(i.clone()) { | 180 | 674 | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | 4.37M | match f.parse(i.clone()) { | 183 | 979 | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | 0 | Err(e) => return Err(e), | 185 | 4.37M | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | 4.37M | if i1.input_len() == len { | 188 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | 4.37M | } | 190 | | | 191 | 4.37M | res.push(o); | 192 | 4.37M | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | 0 | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | 1.65k | } |
|
200 | 34.1k | } nom::multi::many_till::<&[u8], suricata::pgsql::parser::PgsqlErrorNoticeMessageField, &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_error_notice_fields::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>::{closure#0}>Line | Count | Source | 165 | 32.2k | pub fn many_till<I, O, P, E, F, G>( | 166 | 32.2k | mut f: F, | 167 | 32.2k | mut g: G, | 168 | 32.2k | ) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E> | 169 | 32.2k | where | 170 | 32.2k | I: Clone + InputLength, | 171 | 32.2k | F: Parser<I, O, E>, | 172 | 32.2k | G: Parser<I, P, E>, | 173 | 32.2k | E: ParseError<I>, | 174 | | { | 175 | | move |mut i: I| { | 176 | | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | | let len = i.input_len(); | 179 | | match g.parse(i.clone()) { | 180 | | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | | match f.parse(i.clone()) { | 183 | | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | | Err(e) => return Err(e), | 185 | | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | | if i1.input_len() == len { | 188 | | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | | } | 190 | | | 191 | | res.push(o); | 192 | | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | | } | 200 | 32.2k | } |
nom::multi::many_till::<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_readdir_entry>::{closure#0}, nom::combinator::peek<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::tag<&[u8; 4], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}>Line | Count | Source | 165 | 8 | pub fn many_till<I, O, P, E, F, G>( | 166 | 8 | mut f: F, | 167 | 8 | mut g: G, | 168 | 8 | ) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E> | 169 | 8 | where | 170 | 8 | I: Clone + InputLength, | 171 | 8 | F: Parser<I, O, E>, | 172 | 8 | G: Parser<I, P, E>, | 173 | 8 | E: ParseError<I>, | 174 | | { | 175 | | move |mut i: I| { | 176 | | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | | let len = i.input_len(); | 179 | | match g.parse(i.clone()) { | 180 | | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | | match f.parse(i.clone()) { | 183 | | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | | Err(e) => return Err(e), | 185 | | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | | if i1.input_len() == len { | 188 | | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | | } | 190 | | | 191 | | res.push(o); | 192 | | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | | } | 200 | 8 | } |
nom::multi::many_till::<&[u8], &[u8], (char, &[u8]), nom::error::Error<&[u8]>, nom::sequence::terminated<&[u8], &[u8], &[u8], nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], core::option::Option<char>, &[u8], nom::error::Error<&[u8]>, nom::combinator::opt<&[u8], char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::bytes::complete::take_until<&[u8], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, nom::sequence::pair<&[u8], char, &[u8], nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>Line | Count | Source | 165 | 290 | pub fn many_till<I, O, P, E, F, G>( | 166 | 290 | mut f: F, | 167 | 290 | mut g: G, | 168 | 290 | ) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E> | 169 | 290 | where | 170 | 290 | I: Clone + InputLength, | 171 | 290 | F: Parser<I, O, E>, | 172 | 290 | G: Parser<I, P, E>, | 173 | 290 | E: ParseError<I>, | 174 | | { | 175 | | move |mut i: I| { | 176 | | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | | let len = i.input_len(); | 179 | | match g.parse(i.clone()) { | 180 | | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | | match f.parse(i.clone()) { | 183 | | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | | Err(e) => return Err(e), | 185 | | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | | if i1.input_len() == len { | 188 | | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | | } | 190 | | | 191 | | res.push(o); | 192 | | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | | } | 200 | 290 | } |
Unexecuted instantiation: nom::multi::many_till::<_, _, _, _, _, _> Unexecuted instantiation: nom::multi::many_till::<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, &[u8], nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], core::option::Option<suricata::nfs::nfs4_records::Nfs4ResponseReaddirEntry>, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_readdir_entry>::{closure#0}, nom::combinator::peek<&[u8], &[u8], nom::error::Error<&[u8]>, nom::bytes::streaming::tag<&[u8; 4], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}>nom::multi::many_till::<&[u8], &[u8], (char, &[u8]), nom::error::Error<&[u8]>, nom::sequence::terminated<&[u8], &[u8], &[u8], nom::error::Error<&[u8]>, nom::sequence::preceded<&[u8], core::option::Option<char>, &[u8], nom::error::Error<&[u8]>, nom::combinator::opt<&[u8], char, nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::bytes::complete::take_until<&[u8], &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}, nom::sequence::pair<&[u8], char, &[u8], nom::error::Error<&[u8]>, nom::character::complete::char<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::character::complete::crlf<&[u8], nom::error::Error<&[u8]>>>::{closure#0}>Line | Count | Source | 165 | 1.66k | pub fn many_till<I, O, P, E, F, G>( | 166 | 1.66k | mut f: F, | 167 | 1.66k | mut g: G, | 168 | 1.66k | ) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E> | 169 | 1.66k | where | 170 | 1.66k | I: Clone + InputLength, | 171 | 1.66k | F: Parser<I, O, E>, | 172 | 1.66k | G: Parser<I, P, E>, | 173 | 1.66k | E: ParseError<I>, | 174 | | { | 175 | | move |mut i: I| { | 176 | | let mut res = crate::lib::std::vec::Vec::new(); | 177 | | loop { | 178 | | let len = i.input_len(); | 179 | | match g.parse(i.clone()) { | 180 | | Ok((i1, o)) => return Ok((i1, (res, o))), | 181 | | Err(Err::Error(_)) => { | 182 | | match f.parse(i.clone()) { | 183 | | Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))), | 184 | | Err(e) => return Err(e), | 185 | | Ok((i1, o)) => { | 186 | | // infinite loop check: the parser must always consume | 187 | | if i1.input_len() == len { | 188 | | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill))); | 189 | | } | 190 | | | 191 | | res.push(o); | 192 | | i = i1; | 193 | | } | 194 | | } | 195 | | } | 196 | | Err(e) => return Err(e), | 197 | | } | 198 | | } | 199 | | } | 200 | 1.66k | } |
Unexecuted instantiation: nom::multi::many_till::<_, _, _, _, _, _> |
201 | | |
202 | | /// Alternates between two parsers to produce a list of elements. |
203 | | /// |
204 | | /// This stops when either parser returns [`Err::Error`] and returns the results that were accumulated. To instead chain an error up, see |
205 | | /// [`cut`][crate::combinator::cut]. |
206 | | /// |
207 | | /// # Arguments |
208 | | /// * `sep` Parses the separator between list elements. |
209 | | /// * `f` Parses the elements of the list. |
210 | | /// |
211 | | /// ```rust |
212 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
213 | | /// use nom::multi::separated_list0; |
214 | | /// use nom::bytes::complete::tag; |
215 | | /// |
216 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
217 | | /// separated_list0(tag("|"), tag("abc"))(s) |
218 | | /// } |
219 | | /// |
220 | | /// assert_eq!(parser("abc|abc|abc"), Ok(("", vec!["abc", "abc", "abc"]))); |
221 | | /// assert_eq!(parser("abc123abc"), Ok(("123abc", vec!["abc"]))); |
222 | | /// assert_eq!(parser("abc|def"), Ok(("|def", vec!["abc"]))); |
223 | | /// assert_eq!(parser(""), Ok(("", vec![]))); |
224 | | /// assert_eq!(parser("def|abc"), Ok(("def|abc", vec![]))); |
225 | | /// ``` |
226 | | #[cfg(feature = "alloc")] |
227 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
228 | 0 | pub fn separated_list0<I, O, O2, E, F, G>( |
229 | 0 | mut sep: G, |
230 | 0 | mut f: F, |
231 | 0 | ) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
232 | 0 | where |
233 | 0 | I: Clone + InputLength, |
234 | 0 | F: Parser<I, O, E>, |
235 | 0 | G: Parser<I, O2, E>, |
236 | 0 | E: ParseError<I>, |
237 | | { |
238 | 0 | move |mut i: I| { |
239 | 0 | let mut res = Vec::new(); |
240 | | |
241 | 0 | match f.parse(i.clone()) { |
242 | 0 | Err(Err::Error(_)) => return Ok((i, res)), |
243 | 0 | Err(e) => return Err(e), |
244 | 0 | Ok((i1, o)) => { |
245 | 0 | res.push(o); |
246 | 0 | i = i1; |
247 | 0 | } |
248 | | } |
249 | | |
250 | | loop { |
251 | 0 | let len = i.input_len(); |
252 | 0 | match sep.parse(i.clone()) { |
253 | 0 | Err(Err::Error(_)) => return Ok((i, res)), |
254 | 0 | Err(e) => return Err(e), |
255 | 0 | Ok((i1, _)) => { |
256 | | // infinite loop check: the parser must always consume |
257 | 0 | if i1.input_len() == len { |
258 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList))); |
259 | 0 | } |
260 | | |
261 | 0 | match f.parse(i1.clone()) { |
262 | 0 | Err(Err::Error(_)) => return Ok((i, res)), |
263 | 0 | Err(e) => return Err(e), |
264 | 0 | Ok((i2, o)) => { |
265 | 0 | res.push(o); |
266 | 0 | i = i2; |
267 | 0 | } |
268 | | } |
269 | | } |
270 | | } |
271 | | } |
272 | 0 | } Unexecuted instantiation: nom::multi::separated_list0::<_, _, _, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::separated_list0::<_, _, _, _, _, _>::{closure#0} |
273 | 0 | } Unexecuted instantiation: nom::multi::separated_list0::<_, _, _, _, _, _> Unexecuted instantiation: nom::multi::separated_list0::<_, _, _, _, _, _> |
274 | | |
275 | | /// Alternates between two parsers to produce a list of elements until [`Err::Error`]. |
276 | | /// |
277 | | /// Fails if the element parser does not produce at least one element.$ |
278 | | /// |
279 | | /// This stops when either parser returns [`Err::Error`] and returns the results that were accumulated. To instead chain an error up, see |
280 | | /// [`cut`][crate::combinator::cut]. |
281 | | /// |
282 | | /// # Arguments |
283 | | /// * `sep` Parses the separator between list elements. |
284 | | /// * `f` Parses the elements of the list. |
285 | | /// ```rust |
286 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
287 | | /// use nom::multi::separated_list1; |
288 | | /// use nom::bytes::complete::tag; |
289 | | /// |
290 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
291 | | /// separated_list1(tag("|"), tag("abc"))(s) |
292 | | /// } |
293 | | /// |
294 | | /// assert_eq!(parser("abc|abc|abc"), Ok(("", vec!["abc", "abc", "abc"]))); |
295 | | /// assert_eq!(parser("abc123abc"), Ok(("123abc", vec!["abc"]))); |
296 | | /// assert_eq!(parser("abc|def"), Ok(("|def", vec!["abc"]))); |
297 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Tag)))); |
298 | | /// assert_eq!(parser("def|abc"), Err(Err::Error(Error::new("def|abc", ErrorKind::Tag)))); |
299 | | /// ``` |
300 | | #[cfg(feature = "alloc")] |
301 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
302 | 43.5k | pub fn separated_list1<I, O, O2, E, F, G>( |
303 | 43.5k | mut sep: G, |
304 | 43.5k | mut f: F, |
305 | 43.5k | ) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
306 | 43.5k | where |
307 | 43.5k | I: Clone + InputLength, |
308 | 43.5k | F: Parser<I, O, E>, |
309 | 43.5k | G: Parser<I, O2, E>, |
310 | 43.5k | E: ParseError<I>, |
311 | | { |
312 | 43.5k | move |mut i: I| { |
313 | 43.5k | let mut res = Vec::new(); |
314 | | |
315 | | // Parse the first element |
316 | 43.5k | match f.parse(i.clone()) { |
317 | 525 | Err(e) => return Err(e), |
318 | 42.9k | Ok((i1, o)) => { |
319 | 42.9k | res.push(o); |
320 | 42.9k | i = i1; |
321 | 42.9k | } |
322 | | } |
323 | | |
324 | | loop { |
325 | 155k | let len = i.input_len(); |
326 | 155k | match sep.parse(i.clone()) { |
327 | 39.6k | Err(Err::Error(_)) => return Ok((i, res)), |
328 | 0 | Err(e) => return Err(e), |
329 | 115k | Ok((i1, _)) => { |
330 | | // infinite loop check: the parser must always consume |
331 | 115k | if i1.input_len() == len { |
332 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList))); |
333 | 115k | } |
334 | | |
335 | 115k | match f.parse(i1.clone()) { |
336 | 3.31k | Err(Err::Error(_)) => return Ok((i, res)), |
337 | 0 | Err(e) => return Err(e), |
338 | 112k | Ok((i2, o)) => { |
339 | 112k | res.push(o); |
340 | 112k | i = i2; |
341 | 112k | } |
342 | | } |
343 | | } |
344 | | } |
345 | | } |
346 | 43.5k | } nom::multi::separated_list1::<&str, &str, &str, suricata::detect::error::RuleParseError<&str>, nom::sequence::preceded<&str, &str, &str, suricata::detect::error::RuleParseError<&str>, nom::character::complete::multispace0<&str, suricata::detect::error::RuleParseError<&str>>, nom::bytes::complete::is_not<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}>::{closure#0}, nom::bytes::complete::tag<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}>::{closure#0}Line | Count | Source | 312 | 36.0k | move |mut i: I| { | 313 | 36.0k | let mut res = Vec::new(); | 314 | | | 315 | | // Parse the first element | 316 | 36.0k | match f.parse(i.clone()) { | 317 | 13 | Err(e) => return Err(e), | 318 | 36.0k | Ok((i1, o)) => { | 319 | 36.0k | res.push(o); | 320 | 36.0k | i = i1; | 321 | 36.0k | } | 322 | | } | 323 | | | 324 | | loop { | 325 | 143k | let len = i.input_len(); | 326 | 143k | match sep.parse(i.clone()) { | 327 | 33.6k | Err(Err::Error(_)) => return Ok((i, res)), | 328 | 0 | Err(e) => return Err(e), | 329 | 110k | Ok((i1, _)) => { | 330 | | // infinite loop check: the parser must always consume | 331 | 110k | if i1.input_len() == len { | 332 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList))); | 333 | 110k | } | 334 | | | 335 | 110k | match f.parse(i1.clone()) { | 336 | 2.43k | Err(Err::Error(_)) => return Ok((i, res)), | 337 | 0 | Err(e) => return Err(e), | 338 | 107k | Ok((i2, o)) => { | 339 | 107k | res.push(o); | 340 | 107k | i = i2; | 341 | 107k | } | 342 | | } | 343 | | } | 344 | | } | 345 | | } | 346 | 36.0k | } |
nom::multi::separated_list1::<&str, alloc::vec::Vec<(suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion)>, &str, nom::error::Error<&str>, nom::multi::many1<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, nom::sequence::tuple<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, (suricata::detect::requires::parse_op, suricata::detect::requires::parse_version)>::{closure#0}>::{closure#0}, nom::sequence::preceded<&str, &str, &str, nom::error::Error<&str>, nom::character::complete::multispace0<&str, nom::error::Error<&str>>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}>::{closure#0}Line | Count | Source | 312 | 7.43k | move |mut i: I| { | 313 | 7.43k | let mut res = Vec::new(); | 314 | | | 315 | | // Parse the first element | 316 | 7.43k | match f.parse(i.clone()) { | 317 | 512 | Err(e) => return Err(e), | 318 | 6.92k | Ok((i1, o)) => { | 319 | 6.92k | res.push(o); | 320 | 6.92k | i = i1; | 321 | 6.92k | } | 322 | | } | 323 | | | 324 | | loop { | 325 | 11.6k | let len = i.input_len(); | 326 | 11.6k | match sep.parse(i.clone()) { | 327 | 6.04k | Err(Err::Error(_)) => return Ok((i, res)), | 328 | 0 | Err(e) => return Err(e), | 329 | 5.61k | Ok((i1, _)) => { | 330 | | // infinite loop check: the parser must always consume | 331 | 5.61k | if i1.input_len() == len { | 332 | 0 | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList))); | 333 | 5.61k | } | 334 | | | 335 | 5.61k | match f.parse(i1.clone()) { | 336 | 879 | Err(Err::Error(_)) => return Ok((i, res)), | 337 | 0 | Err(e) => return Err(e), | 338 | 4.74k | Ok((i2, o)) => { | 339 | 4.74k | res.push(o); | 340 | 4.74k | i = i2; | 341 | 4.74k | } | 342 | | } | 343 | | } | 344 | | } | 345 | | } | 346 | 7.43k | } |
Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _>::{closure#0} |
347 | 43.5k | } nom::multi::separated_list1::<&str, &str, &str, suricata::detect::error::RuleParseError<&str>, nom::sequence::preceded<&str, &str, &str, suricata::detect::error::RuleParseError<&str>, nom::character::complete::multispace0<&str, suricata::detect::error::RuleParseError<&str>>, nom::bytes::complete::is_not<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}>::{closure#0}, nom::bytes::complete::tag<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}>Line | Count | Source | 302 | 36.0k | pub fn separated_list1<I, O, O2, E, F, G>( | 303 | 36.0k | mut sep: G, | 304 | 36.0k | mut f: F, | 305 | 36.0k | ) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 306 | 36.0k | where | 307 | 36.0k | I: Clone + InputLength, | 308 | 36.0k | F: Parser<I, O, E>, | 309 | 36.0k | G: Parser<I, O2, E>, | 310 | 36.0k | E: ParseError<I>, | 311 | | { | 312 | | move |mut i: I| { | 313 | | let mut res = Vec::new(); | 314 | | | 315 | | // Parse the first element | 316 | | match f.parse(i.clone()) { | 317 | | Err(e) => return Err(e), | 318 | | Ok((i1, o)) => { | 319 | | res.push(o); | 320 | | i = i1; | 321 | | } | 322 | | } | 323 | | | 324 | | loop { | 325 | | let len = i.input_len(); | 326 | | match sep.parse(i.clone()) { | 327 | | Err(Err::Error(_)) => return Ok((i, res)), | 328 | | Err(e) => return Err(e), | 329 | | Ok((i1, _)) => { | 330 | | // infinite loop check: the parser must always consume | 331 | | if i1.input_len() == len { | 332 | | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList))); | 333 | | } | 334 | | | 335 | | match f.parse(i1.clone()) { | 336 | | Err(Err::Error(_)) => return Ok((i, res)), | 337 | | Err(e) => return Err(e), | 338 | | Ok((i2, o)) => { | 339 | | res.push(o); | 340 | | i = i2; | 341 | | } | 342 | | } | 343 | | } | 344 | | } | 345 | | } | 346 | | } | 347 | 36.0k | } |
nom::multi::separated_list1::<&str, alloc::vec::Vec<(suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion)>, &str, nom::error::Error<&str>, nom::multi::many1<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, nom::sequence::tuple<&str, (suricata::detect::requires::VersionCompareOp, suricata::detect::requires::SuricataVersion), nom::error::Error<&str>, (suricata::detect::requires::parse_op, suricata::detect::requires::parse_version)>::{closure#0}>::{closure#0}, nom::sequence::preceded<&str, &str, &str, nom::error::Error<&str>, nom::character::complete::multispace0<&str, nom::error::Error<&str>>, nom::bytes::complete::tag<&str, &str, nom::error::Error<&str>>::{closure#0}>::{closure#0}>Line | Count | Source | 302 | 7.43k | pub fn separated_list1<I, O, O2, E, F, G>( | 303 | 7.43k | mut sep: G, | 304 | 7.43k | mut f: F, | 305 | 7.43k | ) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 306 | 7.43k | where | 307 | 7.43k | I: Clone + InputLength, | 308 | 7.43k | F: Parser<I, O, E>, | 309 | 7.43k | G: Parser<I, O2, E>, | 310 | 7.43k | E: ParseError<I>, | 311 | | { | 312 | | move |mut i: I| { | 313 | | let mut res = Vec::new(); | 314 | | | 315 | | // Parse the first element | 316 | | match f.parse(i.clone()) { | 317 | | Err(e) => return Err(e), | 318 | | Ok((i1, o)) => { | 319 | | res.push(o); | 320 | | i = i1; | 321 | | } | 322 | | } | 323 | | | 324 | | loop { | 325 | | let len = i.input_len(); | 326 | | match sep.parse(i.clone()) { | 327 | | Err(Err::Error(_)) => return Ok((i, res)), | 328 | | Err(e) => return Err(e), | 329 | | Ok((i1, _)) => { | 330 | | // infinite loop check: the parser must always consume | 331 | | if i1.input_len() == len { | 332 | | return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList))); | 333 | | } | 334 | | | 335 | | match f.parse(i1.clone()) { | 336 | | Err(Err::Error(_)) => return Ok((i, res)), | 337 | | Err(e) => return Err(e), | 338 | | Ok((i2, o)) => { | 339 | | res.push(o); | 340 | | i = i2; | 341 | | } | 342 | | } | 343 | | } | 344 | | } | 345 | | } | 346 | | } | 347 | 7.43k | } |
Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _> Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _> |
348 | | |
349 | | /// Repeats the embedded parser `m..=n` times |
350 | | /// |
351 | | /// This stops before `n` when the parser returns [`Err::Error`] and returns the results that were accumulated. To instead chain an error up, see |
352 | | /// [`cut`][crate::combinator::cut]. |
353 | | /// |
354 | | /// # Arguments |
355 | | /// * `m` The minimum number of iterations. |
356 | | /// * `n` The maximum number of iterations. |
357 | | /// * `f` The parser to apply. |
358 | | /// |
359 | | /// *Note*: If the parser passed to `many1` accepts empty inputs |
360 | | /// (like `alpha0` or `digit0`), `many1` will return an error, |
361 | | /// to prevent going into an infinite loop. |
362 | | /// |
363 | | /// ```rust |
364 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
365 | | /// use nom::multi::many_m_n; |
366 | | /// use nom::bytes::complete::tag; |
367 | | /// |
368 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
369 | | /// many_m_n(0, 2, tag("abc"))(s) |
370 | | /// } |
371 | | /// |
372 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
373 | | /// assert_eq!(parser("abc123"), Ok(("123", vec!["abc"]))); |
374 | | /// assert_eq!(parser("123123"), Ok(("123123", vec![]))); |
375 | | /// assert_eq!(parser(""), Ok(("", vec![]))); |
376 | | /// assert_eq!(parser("abcabcabc"), Ok(("abc", vec!["abc", "abc"]))); |
377 | | /// ``` |
378 | | #[cfg(feature = "alloc")] |
379 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
380 | 0 | pub fn many_m_n<I, O, E, F>( |
381 | 0 | min: usize, |
382 | 0 | max: usize, |
383 | 0 | mut parse: F, |
384 | 0 | ) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
385 | 0 | where |
386 | 0 | I: Clone + InputLength, |
387 | 0 | F: Parser<I, O, E>, |
388 | 0 | E: ParseError<I>, |
389 | | { |
390 | 0 | move |mut input: I| { |
391 | 0 | if min > max { |
392 | 0 | return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN))); |
393 | 0 | } |
394 | | |
395 | 0 | let max_initial_capacity = |
396 | 0 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); |
397 | 0 | let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity)); |
398 | 0 | for count in 0..max { |
399 | 0 | let len = input.input_len(); |
400 | 0 | match parse.parse(input.clone()) { |
401 | 0 | Ok((tail, value)) => { |
402 | | // infinite loop check: the parser must always consume |
403 | 0 | if tail.input_len() == len { |
404 | 0 | return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN))); |
405 | 0 | } |
406 | | |
407 | 0 | res.push(value); |
408 | 0 | input = tail; |
409 | | } |
410 | 0 | Err(Err::Error(e)) => { |
411 | 0 | if count < min { |
412 | 0 | return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e))); |
413 | | } else { |
414 | 0 | return Ok((input, res)); |
415 | | } |
416 | | } |
417 | 0 | Err(e) => { |
418 | 0 | return Err(e); |
419 | | } |
420 | | } |
421 | | } |
422 | | |
423 | 0 | Ok((input, res)) |
424 | 0 | } Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _>::{closure#0} |
425 | 0 | } Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _> Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _> |
426 | | |
427 | | /// Repeats the embedded parser, counting the results |
428 | | /// |
429 | | /// This stops on [`Err::Error`]. To instead chain an error up, see |
430 | | /// [`cut`][crate::combinator::cut]. |
431 | | /// |
432 | | /// # Arguments |
433 | | /// * `f` The parser to apply. |
434 | | /// |
435 | | /// *Note*: if the parser passed in accepts empty inputs (like `alpha0` or `digit0`), `many0` will |
436 | | /// return an error, to prevent going into an infinite loop |
437 | | /// |
438 | | /// ```rust |
439 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
440 | | /// use nom::multi::many0_count; |
441 | | /// use nom::bytes::complete::tag; |
442 | | /// |
443 | | /// fn parser(s: &str) -> IResult<&str, usize> { |
444 | | /// many0_count(tag("abc"))(s) |
445 | | /// } |
446 | | /// |
447 | | /// assert_eq!(parser("abcabc"), Ok(("", 2))); |
448 | | /// assert_eq!(parser("abc123"), Ok(("123", 1))); |
449 | | /// assert_eq!(parser("123123"), Ok(("123123", 0))); |
450 | | /// assert_eq!(parser(""), Ok(("", 0))); |
451 | | /// ``` |
452 | 0 | pub fn many0_count<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, usize, E> |
453 | 0 | where |
454 | 0 | I: Clone + InputLength, |
455 | 0 | F: Parser<I, O, E>, |
456 | 0 | E: ParseError<I>, |
457 | | { |
458 | 0 | move |i: I| { |
459 | 0 | let mut input = i; |
460 | 0 | let mut count = 0; |
461 | | |
462 | | loop { |
463 | 0 | let input_ = input.clone(); |
464 | 0 | let len = input.input_len(); |
465 | 0 | match f.parse(input_) { |
466 | 0 | Ok((i, _)) => { |
467 | | // infinite loop check: the parser must always consume |
468 | 0 | if i.input_len() == len { |
469 | 0 | return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0Count))); |
470 | 0 | } |
471 | | |
472 | 0 | input = i; |
473 | 0 | count += 1; |
474 | | } |
475 | | |
476 | 0 | Err(Err::Error(_)) => return Ok((input, count)), |
477 | | |
478 | 0 | Err(e) => return Err(e), |
479 | | } |
480 | | } |
481 | 0 | } Unexecuted instantiation: nom::multi::many0_count::<_, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::many0_count::<_, _, _, _>::{closure#0} |
482 | 0 | } Unexecuted instantiation: nom::multi::many0_count::<_, _, _, _> Unexecuted instantiation: nom::multi::many0_count::<_, _, _, _> |
483 | | |
484 | | /// Runs the embedded parser, counting the results. |
485 | | /// |
486 | | /// This stops on [`Err::Error`] if there is at least one result. To instead chain an error up, |
487 | | /// see [`cut`][crate::combinator::cut]. |
488 | | /// |
489 | | /// # Arguments |
490 | | /// * `f` The parser to apply. |
491 | | /// |
492 | | /// *Note*: If the parser passed to `many1` accepts empty inputs |
493 | | /// (like `alpha0` or `digit0`), `many1` will return an error, |
494 | | /// to prevent going into an infinite loop. |
495 | | /// |
496 | | /// ```rust |
497 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
498 | | /// use nom::multi::many1_count; |
499 | | /// use nom::bytes::complete::tag; |
500 | | /// |
501 | | /// fn parser(s: &str) -> IResult<&str, usize> { |
502 | | /// many1_count(tag("abc"))(s) |
503 | | /// } |
504 | | /// |
505 | | /// assert_eq!(parser("abcabc"), Ok(("", 2))); |
506 | | /// assert_eq!(parser("abc123"), Ok(("123", 1))); |
507 | | /// assert_eq!(parser("123123"), Err(Err::Error(Error::new("123123", ErrorKind::Many1Count)))); |
508 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Many1Count)))); |
509 | | /// ``` |
510 | 5.82k | pub fn many1_count<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, usize, E> |
511 | 5.82k | where |
512 | 5.82k | I: Clone + InputLength, |
513 | 5.82k | F: Parser<I, O, E>, |
514 | 5.82k | E: ParseError<I>, |
515 | | { |
516 | 5.82k | move |i: I| { |
517 | 5.82k | let i_ = i.clone(); |
518 | 5.82k | match f.parse(i_) { |
519 | 443 | Err(Err::Error(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))), |
520 | 0 | Err(i) => Err(i), |
521 | 5.38k | Ok((i1, _)) => { |
522 | 5.38k | let mut count = 1; |
523 | 5.38k | let mut input = i1; |
524 | | |
525 | | loop { |
526 | 225k | let len = input.input_len(); |
527 | 225k | let input_ = input.clone(); |
528 | 225k | match f.parse(input_) { |
529 | 5.38k | Err(Err::Error(_)) => return Ok((input, count)), |
530 | 0 | Err(e) => return Err(e), |
531 | 220k | Ok((i, _)) => { |
532 | | // infinite loop check: the parser must always consume |
533 | 220k | if i.input_len() == len { |
534 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))); |
535 | 220k | } |
536 | | |
537 | 220k | count += 1; |
538 | 220k | input = i; |
539 | | } |
540 | | } |
541 | | } |
542 | | } |
543 | | } |
544 | 5.82k | } nom::multi::many1_count::<&[u8], (), nom::error::Error<&[u8]>, suricata::util::parse_subdomain>::{closure#0}Line | Count | Source | 516 | 5.82k | move |i: I| { | 517 | 5.82k | let i_ = i.clone(); | 518 | 5.82k | match f.parse(i_) { | 519 | 443 | Err(Err::Error(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))), | 520 | 0 | Err(i) => Err(i), | 521 | 5.38k | Ok((i1, _)) => { | 522 | 5.38k | let mut count = 1; | 523 | 5.38k | let mut input = i1; | 524 | | | 525 | | loop { | 526 | 225k | let len = input.input_len(); | 527 | 225k | let input_ = input.clone(); | 528 | 225k | match f.parse(input_) { | 529 | 5.38k | Err(Err::Error(_)) => return Ok((input, count)), | 530 | 0 | Err(e) => return Err(e), | 531 | 220k | Ok((i, _)) => { | 532 | | // infinite loop check: the parser must always consume | 533 | 220k | if i.input_len() == len { | 534 | 0 | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))); | 535 | 220k | } | 536 | | | 537 | 220k | count += 1; | 538 | 220k | input = i; | 539 | | } | 540 | | } | 541 | | } | 542 | | } | 543 | | } | 544 | 5.82k | } |
Unexecuted instantiation: nom::multi::many1_count::<_, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::many1_count::<_, _, _, _>::{closure#0} |
545 | 5.82k | } nom::multi::many1_count::<&[u8], (), nom::error::Error<&[u8]>, suricata::util::parse_subdomain> Line | Count | Source | 510 | 5.82k | pub fn many1_count<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, usize, E> | 511 | 5.82k | where | 512 | 5.82k | I: Clone + InputLength, | 513 | 5.82k | F: Parser<I, O, E>, | 514 | 5.82k | E: ParseError<I>, | 515 | | { | 516 | | move |i: I| { | 517 | | let i_ = i.clone(); | 518 | | match f.parse(i_) { | 519 | | Err(Err::Error(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))), | 520 | | Err(i) => Err(i), | 521 | | Ok((i1, _)) => { | 522 | | let mut count = 1; | 523 | | let mut input = i1; | 524 | | | 525 | | loop { | 526 | | let len = input.input_len(); | 527 | | let input_ = input.clone(); | 528 | | match f.parse(input_) { | 529 | | Err(Err::Error(_)) => return Ok((input, count)), | 530 | | Err(e) => return Err(e), | 531 | | Ok((i, _)) => { | 532 | | // infinite loop check: the parser must always consume | 533 | | if i.input_len() == len { | 534 | | return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))); | 535 | | } | 536 | | | 537 | | count += 1; | 538 | | input = i; | 539 | | } | 540 | | } | 541 | | } | 542 | | } | 543 | | } | 544 | | } | 545 | 5.82k | } |
Unexecuted instantiation: nom::multi::many1_count::<_, _, _, _> Unexecuted instantiation: nom::multi::many1_count::<_, _, _, _> |
546 | | |
547 | | /// Runs the embedded parser `count` times, gathering the results in a `Vec` |
548 | | /// |
549 | | /// # Arguments |
550 | | /// * `f` The parser to apply. |
551 | | /// * `count` How often to apply the parser. |
552 | | /// ```rust |
553 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
554 | | /// use nom::multi::count; |
555 | | /// use nom::bytes::complete::tag; |
556 | | /// |
557 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
558 | | /// count(tag("abc"), 2)(s) |
559 | | /// } |
560 | | /// |
561 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
562 | | /// assert_eq!(parser("abc123"), Err(Err::Error(Error::new("123", ErrorKind::Tag)))); |
563 | | /// assert_eq!(parser("123123"), Err(Err::Error(Error::new("123123", ErrorKind::Tag)))); |
564 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Tag)))); |
565 | | /// assert_eq!(parser("abcabcabc"), Ok(("abc", vec!["abc", "abc"]))); |
566 | | /// ``` |
567 | | #[cfg(feature = "alloc")] |
568 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))] |
569 | 126k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
570 | 126k | where |
571 | 126k | I: Clone + PartialEq, |
572 | 126k | F: Parser<I, O, E>, |
573 | 126k | E: ParseError<I>, |
574 | | { |
575 | 126k | move |i: I| { |
576 | 126k | let mut input = i.clone(); |
577 | 126k | let max_initial_capacity = |
578 | 126k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); |
579 | 126k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); |
580 | | |
581 | 126k | for _ in 0..count { |
582 | 1.78M | let input_ = input.clone(); |
583 | 1.78M | match f.parse(input_) { |
584 | 1.74M | Ok((i, o)) => { |
585 | 1.74M | res.push(o); |
586 | 1.74M | input = i; |
587 | 1.74M | } |
588 | 24.0k | Err(Err::Error(e)) => { |
589 | 24.0k | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); |
590 | | } |
591 | 12.0k | Err(e) => { |
592 | 12.0k | return Err(e); |
593 | | } |
594 | | } |
595 | | } |
596 | | |
597 | 90.1k | Ok((input, res)) |
598 | 126k | } nom::multi::count::<&[u8], suricata::pgsql::parser::ColumnFieldValue, suricata::pgsql::parser::PgsqlParseError<&[u8]>, nom::combinator::complete<&[u8], suricata::pgsql::parser::ColumnFieldValue, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_data_row_value>::{closure#0}>::{closure#0}Line | Count | Source | 575 | 4.79k | move |i: I| { | 576 | 4.79k | let mut input = i.clone(); | 577 | 4.79k | let max_initial_capacity = | 578 | 4.79k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 4.79k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 4.79k | for _ in 0..count { | 582 | 326k | let input_ = input.clone(); | 583 | 326k | match f.parse(input_) { | 584 | 324k | Ok((i, o)) => { | 585 | 324k | res.push(o); | 586 | 324k | input = i; | 587 | 324k | } | 588 | 2.02k | Err(Err::Error(e)) => { | 589 | 2.02k | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 0 | Err(e) => { | 592 | 0 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 2.76k | Ok((input, res)) | 598 | 4.79k | } |
nom::multi::count::<&[u8], suricata::pgsql::parser::RowField, suricata::pgsql::parser::PgsqlParseError<&[u8]>, nom::combinator::complete<&[u8], suricata::pgsql::parser::RowField, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_row_field>::{closure#0}>::{closure#0}Line | Count | Source | 575 | 13.7k | move |i: I| { | 576 | 13.7k | let mut input = i.clone(); | 577 | 13.7k | let max_initial_capacity = | 578 | 13.7k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 13.7k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 13.7k | for _ in 0..count { | 582 | 83.0k | let input_ = input.clone(); | 583 | 83.0k | match f.parse(input_) { | 584 | 69.4k | Ok((i, o)) => { | 585 | 69.4k | res.push(o); | 586 | 69.4k | input = i; | 587 | 69.4k | } | 588 | 13.5k | Err(Err::Error(e)) => { | 589 | 13.5k | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 0 | Err(e) => { | 592 | 0 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 207 | Ok((input, res)) | 598 | 13.7k | } |
nom::multi::count::<&[u8], suricata::dcerpc::dcerpc::DCERPCBindAckResult, nom::error::Error<&[u8]>, suricata::dcerpc::parser::parse_dcerpc_bindack_result>::{closure#0}Line | Count | Source | 575 | 2.00k | move |i: I| { | 576 | 2.00k | let mut input = i.clone(); | 577 | 2.00k | let max_initial_capacity = | 578 | 2.00k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 2.00k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 2.00k | for _ in 0..count { | 582 | 44.5k | let input_ = input.clone(); | 583 | 44.5k | match f.parse(input_) { | 584 | 44.4k | Ok((i, o)) => { | 585 | 44.4k | res.push(o); | 586 | 44.4k | input = i; | 587 | 44.4k | } | 588 | 14 | Err(Err::Error(e)) => { | 589 | 14 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 15 | Err(e) => { | 592 | 15 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 1.97k | Ok((input, res)) | 598 | 2.00k | } |
nom::multi::count::<&[u8], (suricata::quic::frames::StreamTag, u32), suricata::quic::error::QuicError, nom::combinator::complete<&[u8], (suricata::quic::frames::StreamTag, u32), suricata::quic::error::QuicError, suricata::quic::frames::parse_tag_and_offset>::{closure#0}>::{closure#0}Line | Count | Source | 575 | 12 | move |i: I| { | 576 | 12 | let mut input = i.clone(); | 577 | 12 | let max_initial_capacity = | 578 | 12 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 12 | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 12 | for _ in 0..count { | 582 | 28 | let input_ = input.clone(); | 583 | 28 | match f.parse(input_) { | 584 | 21 | Ok((i, o)) => { | 585 | 21 | res.push(o); | 586 | 21 | input = i; | 587 | 21 | } | 588 | 7 | Err(Err::Error(e)) => { | 589 | 7 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 0 | Err(e) => { | 592 | 0 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 5 | Ok((input, res)) | 598 | 12 | } |
Unexecuted instantiation: nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4Handle, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_parse_handle>::{closure#0}nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4RequestContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::parse_request_compound_command>::{closure#0}Line | Count | Source | 575 | 1.15k | move |i: I| { | 576 | 1.15k | let mut input = i.clone(); | 577 | 1.15k | let max_initial_capacity = | 578 | 1.15k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 1.15k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 1.15k | for _ in 0..count { | 582 | 1.93k | let input_ = input.clone(); | 583 | 1.93k | match f.parse(input_) { | 584 | 788 | Ok((i, o)) => { | 585 | 788 | res.push(o); | 586 | 788 | input = i; | 587 | 788 | } | 588 | 395 | Err(Err::Error(e)) => { | 589 | 395 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 752 | Err(e) => { | 592 | 752 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 12 | Ok((input, res)) | 598 | 1.15k | } |
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4ResponseContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_compound_command>::{closure#0}Line | Count | Source | 575 | 63 | move |i: I| { | 576 | 63 | let mut input = i.clone(); | 577 | 63 | let max_initial_capacity = | 578 | 63 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 63 | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 63 | for _ in 0..count { | 582 | 225 | let input_ = input.clone(); | 583 | 225 | match f.parse(input_) { | 584 | 168 | Ok((i, o)) => { | 585 | 168 | res.push(o); | 586 | 168 | input = i; | 587 | 168 | } | 588 | 38 | Err(Err::Error(e)) => { | 589 | 38 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 19 | Err(e) => { | 592 | 19 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 6 | Ok((input, res)) | 598 | 63 | } |
nom::multi::count::<&[u8], suricata::dns::dns::DNSQueryEntry, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_body::{closure#0}>::{closure#0}Line | Count | Source | 575 | 88.8k | move |i: I| { | 576 | 88.8k | let mut input = i.clone(); | 577 | 88.8k | let max_initial_capacity = | 578 | 88.8k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 88.8k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 88.8k | for _ in 0..count { | 582 | 538k | let input_ = input.clone(); | 583 | 538k | match f.parse(input_) { | 584 | 524k | Ok((i, o)) => { | 585 | 524k | res.push(o); | 586 | 524k | input = i; | 587 | 524k | } | 588 | 7.72k | Err(Err::Error(e)) => { | 589 | 7.72k | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 6.25k | Err(e) => { | 592 | 6.25k | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 74.8k | Ok((input, res)) | 598 | 88.8k | } |
nom::multi::count::<&[u8], suricata::smb::dcerpc_records::DceRpcBindIface, nom::error::Error<&[u8]>, suricata::smb::dcerpc_records::parse_dcerpc_bind_iface>::{closure#0}Line | Count | Source | 575 | 3.44k | move |i: I| { | 576 | 3.44k | let mut input = i.clone(); | 577 | 3.44k | let max_initial_capacity = | 578 | 3.44k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 3.44k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 3.44k | for _ in 0..count { | 582 | 42.0k | let input_ = input.clone(); | 583 | 42.0k | match f.parse(input_) { | 584 | 39.2k | Ok((i, o)) => { | 585 | 39.2k | res.push(o); | 586 | 39.2k | input = i; | 587 | 39.2k | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 2.76k | Err(e) => { | 592 | 2.76k | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 679 | Ok((input, res)) | 598 | 3.44k | } |
nom::multi::count::<&[u8], suricata::smb::dcerpc_records::DceRpcBindIface, nom::error::Error<&[u8]>, suricata::smb::dcerpc_records::parse_dcerpc_bind_iface_big>::{closure#0}Line | Count | Source | 575 | 1.71k | move |i: I| { | 576 | 1.71k | let mut input = i.clone(); | 577 | 1.71k | let max_initial_capacity = | 578 | 1.71k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 1.71k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 1.71k | for _ in 0..count { | 582 | 32.7k | let input_ = input.clone(); | 583 | 32.7k | match f.parse(input_) { | 584 | 31.2k | Ok((i, o)) => { | 585 | 31.2k | res.push(o); | 586 | 31.2k | input = i; | 587 | 31.2k | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 1.53k | Err(e) => { | 592 | 1.53k | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 173 | Ok((input, res)) | 598 | 1.71k | } |
nom::multi::count::<&[u8], suricata::smb::dcerpc_records::DceRpcBindAckResult, nom::error::Error<&[u8]>, suricata::smb::dcerpc_records::parse_dcerpc_bindack_result>::{closure#0}Line | Count | Source | 575 | 2 | move |i: I| { | 576 | 2 | let mut input = i.clone(); | 577 | 2 | let max_initial_capacity = | 578 | 2 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 2 | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 2 | for _ in 0..count { | 582 | 5 | let input_ = input.clone(); | 583 | 5 | match f.parse(input_) { | 584 | 5 | Ok((i, o)) => { | 585 | 5 | res.push(o); | 586 | 5 | input = i; | 587 | 5 | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 0 | Err(e) => { | 592 | 0 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 2 | Ok((input, res)) | 598 | 2 | } |
nom::multi::count::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::le_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 575 | 6.58k | move |i: I| { | 576 | 6.58k | let mut input = i.clone(); | 577 | 6.58k | let max_initial_capacity = | 578 | 6.58k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 6.58k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 6.58k | for _ in 0..count { | 582 | 707k | let input_ = input.clone(); | 583 | 707k | match f.parse(input_) { | 584 | 706k | Ok((i, o)) => { | 585 | 706k | res.push(o); | 586 | 706k | input = i; | 587 | 706k | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 628 | Err(e) => { | 592 | 628 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 5.95k | Ok((input, res)) | 598 | 6.58k | } |
nom::multi::count::<&[u8], ipsec_parser::ikev2_transforms::IkeV2RawTransform, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_transform>::{closure#0}Line | Count | Source | 575 | 12 | move |i: I| { | 576 | 12 | let mut input = i.clone(); | 577 | 12 | let max_initial_capacity = | 578 | 12 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 12 | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 12 | for _ in 0..count { | 582 | 19 | let input_ = input.clone(); | 583 | 19 | match f.parse(input_) { | 584 | 13 | Ok((i, o)) => { | 585 | 13 | res.push(o); | 586 | 13 | input = i; | 587 | 13 | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 6 | Err(e) => { | 592 | 6 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 6 | Ok((input, res)) | 598 | 12 | } |
Unexecuted instantiation: nom::multi::count::<_, _, _, _>::{closure#0}nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4Handle, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_parse_handle>::{closure#0}Line | Count | Source | 575 | 25 | move |i: I| { | 576 | 25 | let mut input = i.clone(); | 577 | 25 | let max_initial_capacity = | 578 | 25 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 25 | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 25 | for _ in 0..count { | 582 | 20 | let input_ = input.clone(); | 583 | 20 | match f.parse(input_) { | 584 | 20 | Ok((i, o)) => { | 585 | 20 | res.push(o); | 586 | 20 | input = i; | 587 | 20 | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 0 | Err(e) => { | 592 | 0 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 25 | Ok((input, res)) | 598 | 25 | } |
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4RequestContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::parse_request_compound_command>::{closure#0}Line | Count | Source | 575 | 2.23k | move |i: I| { | 576 | 2.23k | let mut input = i.clone(); | 577 | 2.23k | let max_initial_capacity = | 578 | 2.23k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 2.23k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 2.23k | for _ in 0..count { | 582 | 5.38k | let input_ = input.clone(); | 583 | 5.38k | match f.parse(input_) { | 584 | 5.24k | Ok((i, o)) => { | 585 | 5.24k | res.push(o); | 586 | 5.24k | input = i; | 587 | 5.24k | } | 588 | 76 | Err(Err::Error(e)) => { | 589 | 76 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 56 | Err(e) => { | 592 | 56 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 2.09k | Ok((input, res)) | 598 | 2.23k | } |
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4ResponseContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_compound_command>::{closure#0}Line | Count | Source | 575 | 1.63k | move |i: I| { | 576 | 1.63k | let mut input = i.clone(); | 577 | 1.63k | let max_initial_capacity = | 578 | 1.63k | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 1.63k | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 1.63k | for _ in 0..count { | 582 | 3.80k | let input_ = input.clone(); | 583 | 3.80k | match f.parse(input_) { | 584 | 3.55k | Ok((i, o)) => { | 585 | 3.55k | res.push(o); | 586 | 3.55k | input = i; | 587 | 3.55k | } | 588 | 201 | Err(Err::Error(e)) => { | 589 | 201 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 52 | Err(e) => { | 592 | 52 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 1.38k | Ok((input, res)) | 598 | 1.63k | } |
nom::multi::count::<&[u8], ipsec_parser::ikev2_transforms::IkeV2RawTransform, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_transform>::{closure#0}Line | Count | Source | 575 | 13 | move |i: I| { | 576 | 13 | let mut input = i.clone(); | 577 | 13 | let max_initial_capacity = | 578 | 13 | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | 13 | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | 13 | for _ in 0..count { | 582 | 48 | let input_ = input.clone(); | 583 | 48 | match f.parse(input_) { | 584 | 45 | Ok((i, o)) => { | 585 | 45 | res.push(o); | 586 | 45 | input = i; | 587 | 45 | } | 588 | 0 | Err(Err::Error(e)) => { | 589 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | 3 | Err(e) => { | 592 | 3 | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | 10 | Ok((input, res)) | 598 | 13 | } |
Unexecuted instantiation: nom::multi::count::<_, _, _, _>::{closure#0} |
599 | 126k | } nom::multi::count::<&[u8], suricata::pgsql::parser::ColumnFieldValue, suricata::pgsql::parser::PgsqlParseError<&[u8]>, nom::combinator::complete<&[u8], suricata::pgsql::parser::ColumnFieldValue, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_data_row_value>::{closure#0}>Line | Count | Source | 569 | 4.79k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 4.79k | where | 571 | 4.79k | I: Clone + PartialEq, | 572 | 4.79k | F: Parser<I, O, E>, | 573 | 4.79k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 4.79k | } |
nom::multi::count::<&[u8], suricata::pgsql::parser::RowField, suricata::pgsql::parser::PgsqlParseError<&[u8]>, nom::combinator::complete<&[u8], suricata::pgsql::parser::RowField, suricata::pgsql::parser::PgsqlParseError<&[u8]>, suricata::pgsql::parser::parse_row_field>::{closure#0}>Line | Count | Source | 569 | 13.7k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 13.7k | where | 571 | 13.7k | I: Clone + PartialEq, | 572 | 13.7k | F: Parser<I, O, E>, | 573 | 13.7k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 13.7k | } |
nom::multi::count::<&[u8], suricata::dcerpc::dcerpc::DCERPCBindAckResult, nom::error::Error<&[u8]>, suricata::dcerpc::parser::parse_dcerpc_bindack_result> Line | Count | Source | 569 | 2.00k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 2.00k | where | 571 | 2.00k | I: Clone + PartialEq, | 572 | 2.00k | F: Parser<I, O, E>, | 573 | 2.00k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 2.00k | } |
nom::multi::count::<&[u8], (suricata::quic::frames::StreamTag, u32), suricata::quic::error::QuicError, nom::combinator::complete<&[u8], (suricata::quic::frames::StreamTag, u32), suricata::quic::error::QuicError, suricata::quic::frames::parse_tag_and_offset>::{closure#0}>Line | Count | Source | 569 | 12 | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 12 | where | 571 | 12 | I: Clone + PartialEq, | 572 | 12 | F: Parser<I, O, E>, | 573 | 12 | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 12 | } |
Unexecuted instantiation: nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4Handle, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_parse_handle> nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4RequestContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::parse_request_compound_command> Line | Count | Source | 569 | 1.15k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 1.15k | where | 571 | 1.15k | I: Clone + PartialEq, | 572 | 1.15k | F: Parser<I, O, E>, | 573 | 1.15k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 1.15k | } |
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4ResponseContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_compound_command> Line | Count | Source | 569 | 63 | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 63 | where | 571 | 63 | I: Clone + PartialEq, | 572 | 63 | F: Parser<I, O, E>, | 573 | 63 | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 63 | } |
nom::multi::count::<&[u8], suricata::dns::dns::DNSQueryEntry, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_body::{closure#0}>Line | Count | Source | 569 | 88.8k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 88.8k | where | 571 | 88.8k | I: Clone + PartialEq, | 572 | 88.8k | F: Parser<I, O, E>, | 573 | 88.8k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 88.8k | } |
nom::multi::count::<&[u8], suricata::smb::dcerpc_records::DceRpcBindIface, nom::error::Error<&[u8]>, suricata::smb::dcerpc_records::parse_dcerpc_bind_iface> Line | Count | Source | 569 | 3.44k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 3.44k | where | 571 | 3.44k | I: Clone + PartialEq, | 572 | 3.44k | F: Parser<I, O, E>, | 573 | 3.44k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 3.44k | } |
nom::multi::count::<&[u8], suricata::smb::dcerpc_records::DceRpcBindIface, nom::error::Error<&[u8]>, suricata::smb::dcerpc_records::parse_dcerpc_bind_iface_big> Line | Count | Source | 569 | 1.71k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 1.71k | where | 571 | 1.71k | I: Clone + PartialEq, | 572 | 1.71k | F: Parser<I, O, E>, | 573 | 1.71k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 1.71k | } |
nom::multi::count::<&[u8], suricata::smb::dcerpc_records::DceRpcBindAckResult, nom::error::Error<&[u8]>, suricata::smb::dcerpc_records::parse_dcerpc_bindack_result> Line | Count | Source | 569 | 2 | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 2 | where | 571 | 2 | I: Clone + PartialEq, | 572 | 2 | F: Parser<I, O, E>, | 573 | 2 | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 2 | } |
nom::multi::count::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::le_u16<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 569 | 6.58k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 6.58k | where | 571 | 6.58k | I: Clone + PartialEq, | 572 | 6.58k | F: Parser<I, O, E>, | 573 | 6.58k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 6.58k | } |
nom::multi::count::<&[u8], ipsec_parser::ikev2_transforms::IkeV2RawTransform, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_transform> Line | Count | Source | 569 | 13 | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 13 | where | 571 | 13 | I: Clone + PartialEq, | 572 | 13 | F: Parser<I, O, E>, | 573 | 13 | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 13 | } |
Unexecuted instantiation: nom::multi::count::<_, _, _, _> nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4Handle, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_parse_handle> Line | Count | Source | 569 | 25 | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 25 | where | 571 | 25 | I: Clone + PartialEq, | 572 | 25 | F: Parser<I, O, E>, | 573 | 25 | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 25 | } |
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4RequestContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::parse_request_compound_command> Line | Count | Source | 569 | 2.23k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 2.23k | where | 571 | 2.23k | I: Clone + PartialEq, | 572 | 2.23k | F: Parser<I, O, E>, | 573 | 2.23k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 2.23k | } |
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4ResponseContent, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_res_compound_command> Line | Count | Source | 569 | 1.63k | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 1.63k | where | 571 | 1.63k | I: Clone + PartialEq, | 572 | 1.63k | F: Parser<I, O, E>, | 573 | 1.63k | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 1.63k | } |
nom::multi::count::<&[u8], ipsec_parser::ikev2_transforms::IkeV2RawTransform, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_transform> Line | Count | Source | 569 | 14 | pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 570 | 14 | where | 571 | 14 | I: Clone + PartialEq, | 572 | 14 | F: Parser<I, O, E>, | 573 | 14 | E: ParseError<I>, | 574 | | { | 575 | | move |i: I| { | 576 | | let mut input = i.clone(); | 577 | | let max_initial_capacity = | 578 | | MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1); | 579 | | let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity)); | 580 | | | 581 | | for _ in 0..count { | 582 | | let input_ = input.clone(); | 583 | | match f.parse(input_) { | 584 | | Ok((i, o)) => { | 585 | | res.push(o); | 586 | | input = i; | 587 | | } | 588 | | Err(Err::Error(e)) => { | 589 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 590 | | } | 591 | | Err(e) => { | 592 | | return Err(e); | 593 | | } | 594 | | } | 595 | | } | 596 | | | 597 | | Ok((input, res)) | 598 | | } | 599 | 14 | } |
Unexecuted instantiation: nom::multi::count::<_, _, _, _> |
600 | | |
601 | | /// Runs the embedded parser repeatedly, filling the given slice with results. |
602 | | /// |
603 | | /// This parser fails if the input runs out before the given slice is full. |
604 | | /// |
605 | | /// # Arguments |
606 | | /// * `f` The parser to apply. |
607 | | /// * `buf` The slice to fill |
608 | | /// ```rust |
609 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
610 | | /// use nom::multi::fill; |
611 | | /// use nom::bytes::complete::tag; |
612 | | /// |
613 | | /// fn parser(s: &str) -> IResult<&str, [&str; 2]> { |
614 | | /// let mut buf = ["", ""]; |
615 | | /// let (rest, ()) = fill(tag("abc"), &mut buf)(s)?; |
616 | | /// Ok((rest, buf)) |
617 | | /// } |
618 | | /// |
619 | | /// assert_eq!(parser("abcabc"), Ok(("", ["abc", "abc"]))); |
620 | | /// assert_eq!(parser("abc123"), Err(Err::Error(Error::new("123", ErrorKind::Tag)))); |
621 | | /// assert_eq!(parser("123123"), Err(Err::Error(Error::new("123123", ErrorKind::Tag)))); |
622 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Tag)))); |
623 | | /// assert_eq!(parser("abcabcabc"), Ok(("abc", ["abc", "abc"]))); |
624 | | /// ``` |
625 | 0 | pub fn fill<'a, I, O, E, F>(f: F, buf: &'a mut [O]) -> impl FnMut(I) -> IResult<I, (), E> + 'a |
626 | 0 | where |
627 | 0 | I: Clone + PartialEq, |
628 | 0 | F: Fn(I) -> IResult<I, O, E> + 'a, |
629 | 0 | E: ParseError<I>, |
630 | | { |
631 | 0 | move |i: I| { |
632 | 0 | let mut input = i.clone(); |
633 | | |
634 | 0 | for elem in buf.iter_mut() { |
635 | 0 | let input_ = input.clone(); |
636 | 0 | match f(input_) { |
637 | 0 | Ok((i, o)) => { |
638 | 0 | *elem = o; |
639 | 0 | input = i; |
640 | 0 | } |
641 | 0 | Err(Err::Error(e)) => { |
642 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); |
643 | | } |
644 | 0 | Err(e) => { |
645 | 0 | return Err(e); |
646 | | } |
647 | | } |
648 | | } |
649 | | |
650 | 0 | Ok((input, ())) |
651 | 0 | } Unexecuted instantiation: nom::multi::fill::<_, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::fill::<_, _, _, _>::{closure#0} |
652 | 0 | } Unexecuted instantiation: nom::multi::fill::<_, _, _, _> Unexecuted instantiation: nom::multi::fill::<_, _, _, _> |
653 | | |
654 | | /// Repeats the embedded parser, calling `g` to gather the results. |
655 | | /// |
656 | | /// This stops on [`Err::Error`]. To instead chain an error up, see |
657 | | /// [`cut`][crate::combinator::cut]. |
658 | | /// |
659 | | /// # Arguments |
660 | | /// * `f` The parser to apply. |
661 | | /// * `init` A function returning the initial value. |
662 | | /// * `g` The function that combines a result of `f` with |
663 | | /// the current accumulator. |
664 | | /// |
665 | | /// *Note*: if the parser passed in accepts empty inputs (like `alpha0` or `digit0`), `many0` will |
666 | | /// return an error, to prevent going into an infinite loop |
667 | | /// |
668 | | /// ```rust |
669 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
670 | | /// use nom::multi::fold_many0; |
671 | | /// use nom::bytes::complete::tag; |
672 | | /// |
673 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
674 | | /// fold_many0( |
675 | | /// tag("abc"), |
676 | | /// Vec::new, |
677 | | /// |mut acc: Vec<_>, item| { |
678 | | /// acc.push(item); |
679 | | /// acc |
680 | | /// } |
681 | | /// )(s) |
682 | | /// } |
683 | | /// |
684 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
685 | | /// assert_eq!(parser("abc123"), Ok(("123", vec!["abc"]))); |
686 | | /// assert_eq!(parser("123123"), Ok(("123123", vec![]))); |
687 | | /// assert_eq!(parser(""), Ok(("", vec![]))); |
688 | | /// ``` |
689 | 173k | pub fn fold_many0<I, O, E, F, G, H, R>( |
690 | 173k | mut f: F, |
691 | 173k | mut init: H, |
692 | 173k | mut g: G, |
693 | 173k | ) -> impl FnMut(I) -> IResult<I, R, E> |
694 | 173k | where |
695 | 173k | I: Clone + InputLength, |
696 | 173k | F: Parser<I, O, E>, |
697 | 173k | G: FnMut(R, O) -> R, |
698 | 173k | H: FnMut() -> R, |
699 | 173k | E: ParseError<I>, |
700 | | { |
701 | 173k | move |i: I| { |
702 | 173k | let mut res = init(); |
703 | 173k | let mut input = i; |
704 | | |
705 | | loop { |
706 | 14.9M | let i_ = input.clone(); |
707 | 14.9M | let len = input.input_len(); |
708 | 14.9M | match f.parse(i_) { |
709 | 14.7M | Ok((i, o)) => { |
710 | | // infinite loop check: the parser must always consume |
711 | 14.7M | if i.input_len() == len { |
712 | 0 | return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0))); |
713 | 14.7M | } |
714 | | |
715 | 14.7M | res = g(res, o); |
716 | 14.7M | input = i; |
717 | | } |
718 | | Err(Err::Error(_)) => { |
719 | 173k | return Ok((input, res)); |
720 | | } |
721 | 0 | Err(e) => { |
722 | 0 | return Err(e); |
723 | | } |
724 | | } |
725 | | } |
726 | 173k | } Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _>::{closure#0}nom::multi::fold_many0::<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, nom::branch::alt<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, (suricata_htp::urlencoded::decode_percent::{closure#0}, suricata_htp::urlencoded::decode_plus::{closure#0}, suricata_htp::urlencoded::unencoded_byte::{closure#0})>::{closure#0}, suricata_htp::urlencoded::decode_uri::{closure#1}, suricata_htp::urlencoded::decode_uri::{closure#0}, (alloc::vec::Vec<u8>, u64, suricata_htp::config::HtpUnwanted)>::{closure#0}Line | Count | Source | 701 | 48.2k | move |i: I| { | 702 | 48.2k | let mut res = init(); | 703 | 48.2k | let mut input = i; | 704 | | | 705 | | loop { | 706 | 5.24M | let i_ = input.clone(); | 707 | 5.24M | let len = input.input_len(); | 708 | 5.24M | match f.parse(i_) { | 709 | 5.19M | Ok((i, o)) => { | 710 | | // infinite loop check: the parser must always consume | 711 | 5.19M | if i.input_len() == len { | 712 | 0 | return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0))); | 713 | 5.19M | } | 714 | | | 715 | 5.19M | res = g(res, o); | 716 | 5.19M | input = i; | 717 | | } | 718 | | Err(Err::Error(_)) => { | 719 | 48.2k | return Ok((input, res)); | 720 | | } | 721 | 0 | Err(e) => { | 722 | 0 | return Err(e); | 723 | | } | 724 | | } | 725 | | } | 726 | 48.2k | } |
nom::multi::fold_many0::<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, nom::branch::alt<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, (suricata_htp::urlencoded::path_decode_percent::{closure#0}, suricata_htp::urlencoded::path_parse_other::{closure#0})>::{closure#0}, suricata_htp::urlencoded::path_decode_uri::{closure#1}, suricata_htp::urlencoded::path_decode_uri::{closure#0}, (alloc::vec::Vec<u8>, u64, suricata_htp::config::HtpUnwanted)>::{closure#0}Line | Count | Source | 701 | 125k | move |i: I| { | 702 | 125k | let mut res = init(); | 703 | 125k | let mut input = i; | 704 | | | 705 | | loop { | 706 | 9.70M | let i_ = input.clone(); | 707 | 9.70M | let len = input.input_len(); | 708 | 9.70M | match f.parse(i_) { | 709 | 9.57M | Ok((i, o)) => { | 710 | | // infinite loop check: the parser must always consume | 711 | 9.57M | if i.input_len() == len { | 712 | 0 | return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0))); | 713 | 9.57M | } | 714 | | | 715 | 9.57M | res = g(res, o); | 716 | 9.57M | input = i; | 717 | | } | 718 | | Err(Err::Error(_)) => { | 719 | 125k | return Ok((input, res)); | 720 | | } | 721 | 0 | Err(e) => { | 722 | 0 | return Err(e); | 723 | | } | 724 | | } | 725 | | } | 726 | 125k | } |
Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _>::{closure#0} |
727 | 173k | } Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _> nom::multi::fold_many0::<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, nom::branch::alt<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, (suricata_htp::urlencoded::decode_percent::{closure#0}, suricata_htp::urlencoded::decode_plus::{closure#0}, suricata_htp::urlencoded::unencoded_byte::{closure#0})>::{closure#0}, suricata_htp::urlencoded::decode_uri::{closure#1}, suricata_htp::urlencoded::decode_uri::{closure#0}, (alloc::vec::Vec<u8>, u64, suricata_htp::config::HtpUnwanted)>Line | Count | Source | 689 | 48.2k | pub fn fold_many0<I, O, E, F, G, H, R>( | 690 | 48.2k | mut f: F, | 691 | 48.2k | mut init: H, | 692 | 48.2k | mut g: G, | 693 | 48.2k | ) -> impl FnMut(I) -> IResult<I, R, E> | 694 | 48.2k | where | 695 | 48.2k | I: Clone + InputLength, | 696 | 48.2k | F: Parser<I, O, E>, | 697 | 48.2k | G: FnMut(R, O) -> R, | 698 | 48.2k | H: FnMut() -> R, | 699 | 48.2k | E: ParseError<I>, | 700 | | { | 701 | | move |i: I| { | 702 | | let mut res = init(); | 703 | | let mut input = i; | 704 | | | 705 | | loop { | 706 | | let i_ = input.clone(); | 707 | | let len = input.input_len(); | 708 | | match f.parse(i_) { | 709 | | Ok((i, o)) => { | 710 | | // infinite loop check: the parser must always consume | 711 | | if i.input_len() == len { | 712 | | return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0))); | 713 | | } | 714 | | | 715 | | res = g(res, o); | 716 | | input = i; | 717 | | } | 718 | | Err(Err::Error(_)) => { | 719 | | return Ok((input, res)); | 720 | | } | 721 | | Err(e) => { | 722 | | return Err(e); | 723 | | } | 724 | | } | 725 | | } | 726 | | } | 727 | 48.2k | } |
nom::multi::fold_many0::<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, nom::branch::alt<&[u8], suricata_htp::urlencoded::UrlParseResult, nom::error::Error<&[u8]>, (suricata_htp::urlencoded::path_decode_percent::{closure#0}, suricata_htp::urlencoded::path_parse_other::{closure#0})>::{closure#0}, suricata_htp::urlencoded::path_decode_uri::{closure#1}, suricata_htp::urlencoded::path_decode_uri::{closure#0}, (alloc::vec::Vec<u8>, u64, suricata_htp::config::HtpUnwanted)>Line | Count | Source | 689 | 125k | pub fn fold_many0<I, O, E, F, G, H, R>( | 690 | 125k | mut f: F, | 691 | 125k | mut init: H, | 692 | 125k | mut g: G, | 693 | 125k | ) -> impl FnMut(I) -> IResult<I, R, E> | 694 | 125k | where | 695 | 125k | I: Clone + InputLength, | 696 | 125k | F: Parser<I, O, E>, | 697 | 125k | G: FnMut(R, O) -> R, | 698 | 125k | H: FnMut() -> R, | 699 | 125k | E: ParseError<I>, | 700 | | { | 701 | | move |i: I| { | 702 | | let mut res = init(); | 703 | | let mut input = i; | 704 | | | 705 | | loop { | 706 | | let i_ = input.clone(); | 707 | | let len = input.input_len(); | 708 | | match f.parse(i_) { | 709 | | Ok((i, o)) => { | 710 | | // infinite loop check: the parser must always consume | 711 | | if i.input_len() == len { | 712 | | return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0))); | 713 | | } | 714 | | | 715 | | res = g(res, o); | 716 | | input = i; | 717 | | } | 718 | | Err(Err::Error(_)) => { | 719 | | return Ok((input, res)); | 720 | | } | 721 | | Err(e) => { | 722 | | return Err(e); | 723 | | } | 724 | | } | 725 | | } | 726 | | } | 727 | 125k | } |
Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _> |
728 | | |
729 | | /// Repeats the embedded parser, calling `g` to gather the results. |
730 | | /// |
731 | | /// This stops on [`Err::Error`] if there is at least one result. To instead chain an error up, |
732 | | /// see [`cut`][crate::combinator::cut]. |
733 | | /// |
734 | | /// # Arguments |
735 | | /// * `f` The parser to apply. |
736 | | /// * `init` A function returning the initial value. |
737 | | /// * `g` The function that combines a result of `f` with |
738 | | /// the current accumulator. |
739 | | /// |
740 | | /// *Note*: If the parser passed to `many1` accepts empty inputs |
741 | | /// (like `alpha0` or `digit0`), `many1` will return an error, |
742 | | /// to prevent going into an infinite loop. |
743 | | /// |
744 | | /// ```rust |
745 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
746 | | /// use nom::multi::fold_many1; |
747 | | /// use nom::bytes::complete::tag; |
748 | | /// |
749 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
750 | | /// fold_many1( |
751 | | /// tag("abc"), |
752 | | /// Vec::new, |
753 | | /// |mut acc: Vec<_>, item| { |
754 | | /// acc.push(item); |
755 | | /// acc |
756 | | /// } |
757 | | /// )(s) |
758 | | /// } |
759 | | /// |
760 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
761 | | /// assert_eq!(parser("abc123"), Ok(("123", vec!["abc"]))); |
762 | | /// assert_eq!(parser("123123"), Err(Err::Error(Error::new("123123", ErrorKind::Many1)))); |
763 | | /// assert_eq!(parser(""), Err(Err::Error(Error::new("", ErrorKind::Many1)))); |
764 | | /// ``` |
765 | 0 | pub fn fold_many1<I, O, E, F, G, H, R>( |
766 | 0 | mut f: F, |
767 | 0 | mut init: H, |
768 | 0 | mut g: G, |
769 | 0 | ) -> impl FnMut(I) -> IResult<I, R, E> |
770 | 0 | where |
771 | 0 | I: Clone + InputLength, |
772 | 0 | F: Parser<I, O, E>, |
773 | 0 | G: FnMut(R, O) -> R, |
774 | 0 | H: FnMut() -> R, |
775 | 0 | E: ParseError<I>, |
776 | | { |
777 | 0 | move |i: I| { |
778 | 0 | let _i = i.clone(); |
779 | 0 | let init = init(); |
780 | 0 | match f.parse(_i) { |
781 | 0 | Err(Err::Error(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))), |
782 | 0 | Err(e) => Err(e), |
783 | 0 | Ok((i1, o1)) => { |
784 | 0 | let mut acc = g(init, o1); |
785 | 0 | let mut input = i1; |
786 | | |
787 | | loop { |
788 | 0 | let _input = input.clone(); |
789 | 0 | let len = input.input_len(); |
790 | 0 | match f.parse(_input) { |
791 | | Err(Err::Error(_)) => { |
792 | 0 | break; |
793 | | } |
794 | 0 | Err(e) => return Err(e), |
795 | 0 | Ok((i, o)) => { |
796 | | // infinite loop check: the parser must always consume |
797 | 0 | if i.input_len() == len { |
798 | 0 | return Err(Err::Failure(E::from_error_kind(i, ErrorKind::Many1))); |
799 | 0 | } |
800 | | |
801 | 0 | acc = g(acc, o); |
802 | 0 | input = i; |
803 | | } |
804 | | } |
805 | | } |
806 | | |
807 | 0 | Ok((input, acc)) |
808 | | } |
809 | | } |
810 | 0 | } Unexecuted instantiation: nom::multi::fold_many1::<_, _, _, _, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::fold_many1::<_, _, _, _, _, _, _>::{closure#0} |
811 | 0 | } Unexecuted instantiation: nom::multi::fold_many1::<_, _, _, _, _, _, _> Unexecuted instantiation: nom::multi::fold_many1::<_, _, _, _, _, _, _> |
812 | | |
813 | | /// Repeats the embedded parser `m..=n` times, calling `g` to gather the results |
814 | | /// |
815 | | /// This stops before `n` when the parser returns [`Err::Error`]. To instead chain an error up, see |
816 | | /// [`cut`][crate::combinator::cut]. |
817 | | /// |
818 | | /// # Arguments |
819 | | /// * `m` The minimum number of iterations. |
820 | | /// * `n` The maximum number of iterations. |
821 | | /// * `f` The parser to apply. |
822 | | /// * `init` A function returning the initial value. |
823 | | /// * `g` The function that combines a result of `f` with |
824 | | /// the current accumulator. |
825 | | /// |
826 | | /// *Note*: If the parser passed to `many1` accepts empty inputs |
827 | | /// (like `alpha0` or `digit0`), `many1` will return an error, |
828 | | /// to prevent going into an infinite loop. |
829 | | /// |
830 | | /// ```rust |
831 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
832 | | /// use nom::multi::fold_many_m_n; |
833 | | /// use nom::bytes::complete::tag; |
834 | | /// |
835 | | /// fn parser(s: &str) -> IResult<&str, Vec<&str>> { |
836 | | /// fold_many_m_n( |
837 | | /// 0, |
838 | | /// 2, |
839 | | /// tag("abc"), |
840 | | /// Vec::new, |
841 | | /// |mut acc: Vec<_>, item| { |
842 | | /// acc.push(item); |
843 | | /// acc |
844 | | /// } |
845 | | /// )(s) |
846 | | /// } |
847 | | /// |
848 | | /// assert_eq!(parser("abcabc"), Ok(("", vec!["abc", "abc"]))); |
849 | | /// assert_eq!(parser("abc123"), Ok(("123", vec!["abc"]))); |
850 | | /// assert_eq!(parser("123123"), Ok(("123123", vec![]))); |
851 | | /// assert_eq!(parser(""), Ok(("", vec![]))); |
852 | | /// assert_eq!(parser("abcabcabc"), Ok(("abc", vec!["abc", "abc"]))); |
853 | | /// ``` |
854 | 0 | pub fn fold_many_m_n<I, O, E, F, G, H, R>( |
855 | 0 | min: usize, |
856 | 0 | max: usize, |
857 | 0 | mut parse: F, |
858 | 0 | mut init: H, |
859 | 0 | mut fold: G, |
860 | 0 | ) -> impl FnMut(I) -> IResult<I, R, E> |
861 | 0 | where |
862 | 0 | I: Clone + InputLength, |
863 | 0 | F: Parser<I, O, E>, |
864 | 0 | G: FnMut(R, O) -> R, |
865 | 0 | H: FnMut() -> R, |
866 | 0 | E: ParseError<I>, |
867 | | { |
868 | 0 | move |mut input: I| { |
869 | 0 | if min > max { |
870 | 0 | return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN))); |
871 | 0 | } |
872 | | |
873 | 0 | let mut acc = init(); |
874 | 0 | for count in 0..max { |
875 | 0 | let len = input.input_len(); |
876 | 0 | match parse.parse(input.clone()) { |
877 | 0 | Ok((tail, value)) => { |
878 | | // infinite loop check: the parser must always consume |
879 | 0 | if tail.input_len() == len { |
880 | 0 | return Err(Err::Error(E::from_error_kind(tail, ErrorKind::ManyMN))); |
881 | 0 | } |
882 | | |
883 | 0 | acc = fold(acc, value); |
884 | 0 | input = tail; |
885 | | } |
886 | | //FInputXMError: handle failure properly |
887 | 0 | Err(Err::Error(err)) => { |
888 | 0 | if count < min { |
889 | 0 | return Err(Err::Error(E::append(input, ErrorKind::ManyMN, err))); |
890 | | } else { |
891 | 0 | break; |
892 | | } |
893 | | } |
894 | 0 | Err(e) => return Err(e), |
895 | | } |
896 | | } |
897 | | |
898 | 0 | Ok((input, acc)) |
899 | 0 | } Unexecuted instantiation: nom::multi::fold_many_m_n::<_, _, _, _, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::fold_many_m_n::<_, _, _, _, _, _, _>::{closure#0} |
900 | 0 | } Unexecuted instantiation: nom::multi::fold_many_m_n::<_, _, _, _, _, _, _> Unexecuted instantiation: nom::multi::fold_many_m_n::<_, _, _, _, _, _, _> |
901 | | |
902 | | /// Gets a number from the parser and returns a |
903 | | /// subslice of the input of that size. |
904 | | /// If the parser returns `Incomplete`, |
905 | | /// `length_data` will return an error. |
906 | | /// # Arguments |
907 | | /// * `f` The parser to apply. |
908 | | /// ```rust |
909 | | /// # use nom::{Err, error::ErrorKind, Needed, IResult}; |
910 | | /// use nom::number::complete::be_u16; |
911 | | /// use nom::multi::length_data; |
912 | | /// use nom::bytes::complete::tag; |
913 | | /// |
914 | | /// fn parser(s: &[u8]) -> IResult<&[u8], &[u8]> { |
915 | | /// length_data(be_u16)(s) |
916 | | /// } |
917 | | /// |
918 | | /// assert_eq!(parser(b"\x00\x03abcefg"), Ok((&b"efg"[..], &b"abc"[..]))); |
919 | | /// assert_eq!(parser(b"\x00\x03a"), Err(Err::Incomplete(Needed::new(2)))); |
920 | | /// ``` |
921 | 4.59M | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> |
922 | 4.59M | where |
923 | 4.59M | I: InputLength + InputTake, |
924 | 4.59M | N: ToUsize, |
925 | 4.59M | F: Parser<I, N, E>, |
926 | 4.59M | E: ParseError<I>, |
927 | | { |
928 | 4.60M | move |i: I| { |
929 | 4.60M | let (i, length) = f.parse(i)?; |
930 | | |
931 | 4.59M | let length: usize = length.to_usize(); |
932 | | |
933 | 4.59M | if let Some(needed) = length |
934 | 4.59M | .checked_sub(i.input_len()) |
935 | 4.59M | .and_then(NonZeroUsize::new) |
936 | | { |
937 | 148k | Err(Err::Incomplete(Needed::Size(needed))) |
938 | | } else { |
939 | 4.44M | Ok(i.take_split(length)) |
940 | | } |
941 | 4.60M | } Unexecuted instantiation: nom::multi::length_data::<&[u8], u32, suricata::rdp::error::RdpError, suricata::rdp::util::parse_per_length_determinant>::{closure#0}nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 3.94M | move |i: I| { | 929 | 3.94M | let (i, length) = f.parse(i)?; | 930 | | | 931 | 3.94M | let length: usize = length.to_usize(); | 932 | | | 933 | 3.94M | if let Some(needed) = length | 934 | 3.94M | .checked_sub(i.input_len()) | 935 | 3.94M | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 8.05k | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 3.93M | Ok(i.take_split(length)) | 940 | | } | 941 | 3.94M | } |
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u32<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 21.5k | move |i: I| { | 929 | 21.5k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 21.2k | let length: usize = length.to_usize(); | 932 | | | 933 | 21.2k | if let Some(needed) = length | 934 | 21.2k | .checked_sub(i.input_len()) | 935 | 21.2k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 9.93k | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 11.3k | Ok(i.take_split(length)) | 940 | | } | 941 | 21.5k | } |
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 591k | move |i: I| { | 929 | 591k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 586k | let length: usize = length.to_usize(); | 932 | | | 933 | 586k | if let Some(needed) = length | 934 | 586k | .checked_sub(i.input_len()) | 935 | 586k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 121k | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 464k | Ok(i.take_split(length)) | 940 | | } | 941 | 591k | } |
nom::multi::length_data::<&[u8], u16, asn1_rs::error::Error, nom::number::streaming::be_u16<&[u8], asn1_rs::error::Error>>::{closure#0}Line | Count | Source | 928 | 16 | move |i: I| { | 929 | 16 | let (i, length) = f.parse(i)?; | 930 | | | 931 | 14 | let length: usize = length.to_usize(); | 932 | | | 933 | 14 | if let Some(needed) = length | 934 | 14 | .checked_sub(i.input_len()) | 935 | 14 | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 0 | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 14 | Ok(i.take_split(length)) | 940 | | } | 941 | 16 | } |
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 123 | move |i: I| { | 929 | 123 | let (i, length) = f.parse(i)?; | 930 | | | 931 | 104 | let length: usize = length.to_usize(); | 932 | | | 933 | 104 | if let Some(needed) = length | 934 | 104 | .checked_sub(i.input_len()) | 935 | 104 | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 21 | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 83 | Ok(i.take_split(length)) | 940 | | } | 941 | 123 | } |
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 97 | move |i: I| { | 929 | 97 | let (i, length) = f.parse(i)?; | 930 | | | 931 | 85 | let length: usize = length.to_usize(); | 932 | | | 933 | 85 | if let Some(needed) = length | 934 | 85 | .checked_sub(i.input_len()) | 935 | 85 | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 68 | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 17 | Ok(i.take_split(length)) | 940 | | } | 941 | 97 | } |
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 9.97k | move |i: I| { | 929 | 9.97k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 9.84k | let length: usize = length.to_usize(); | 932 | | | 933 | 9.84k | if let Some(needed) = length | 934 | 9.84k | .checked_sub(i.input_len()) | 935 | 9.84k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 2.29k | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 7.54k | Ok(i.take_split(length)) | 940 | | } | 941 | 9.97k | } |
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _>::{closure#0}nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u32<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 8.72k | move |i: I| { | 929 | 8.72k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 8.55k | let length: usize = length.to_usize(); | 932 | | | 933 | 8.55k | if let Some(needed) = length | 934 | 8.55k | .checked_sub(i.input_len()) | 935 | 8.55k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 4.23k | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 4.32k | Ok(i.take_split(length)) | 940 | | } | 941 | 8.72k | } |
nom::multi::length_data::<&[u8], u16, asn1_rs::error::Error, nom::number::streaming::be_u16<&[u8], asn1_rs::error::Error>>::{closure#0}Line | Count | Source | 928 | 6.97k | move |i: I| { | 929 | 6.97k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 5.97k | let length: usize = length.to_usize(); | 932 | | | 933 | 5.97k | if let Some(needed) = length | 934 | 5.97k | .checked_sub(i.input_len()) | 935 | 5.97k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 5 | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 5.97k | Ok(i.take_split(length)) | 940 | | } | 941 | 6.97k | } |
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 2.72k | move |i: I| { | 929 | 2.72k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 2.35k | let length: usize = length.to_usize(); | 932 | | | 933 | 2.35k | if let Some(needed) = length | 934 | 2.35k | .checked_sub(i.input_len()) | 935 | 2.35k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 991 | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 1.36k | Ok(i.take_split(length)) | 940 | | } | 941 | 2.72k | } |
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 619 | move |i: I| { | 929 | 619 | let (i, length) = f.parse(i)?; | 930 | | | 931 | 524 | let length: usize = length.to_usize(); | 932 | | | 933 | 524 | if let Some(needed) = length | 934 | 524 | .checked_sub(i.input_len()) | 935 | 524 | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 138 | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 386 | Ok(i.take_split(length)) | 940 | | } | 941 | 619 | } |
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 928 | 14.3k | move |i: I| { | 929 | 14.3k | let (i, length) = f.parse(i)?; | 930 | | | 931 | 12.9k | let length: usize = length.to_usize(); | 932 | | | 933 | 12.9k | if let Some(needed) = length | 934 | 12.9k | .checked_sub(i.input_len()) | 935 | 12.9k | .and_then(NonZeroUsize::new) | 936 | | { | 937 | 1.07k | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | 11.8k | Ok(i.take_split(length)) | 940 | | } | 941 | 14.3k | } |
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _>::{closure#0} |
942 | 4.59M | } Unexecuted instantiation: nom::multi::length_data::<&[u8], u32, suricata::rdp::error::RdpError, suricata::rdp::util::parse_per_length_determinant> nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 3.94M | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 3.94M | where | 923 | 3.94M | I: InputLength + InputTake, | 924 | 3.94M | N: ToUsize, | 925 | 3.94M | F: Parser<I, N, E>, | 926 | 3.94M | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 3.94M | } |
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u32<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 21.5k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 21.5k | where | 923 | 21.5k | I: InputLength + InputTake, | 924 | 21.5k | N: ToUsize, | 925 | 21.5k | F: Parser<I, N, E>, | 926 | 21.5k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 21.5k | } |
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 591k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 591k | where | 923 | 591k | I: InputLength + InputTake, | 924 | 591k | N: ToUsize, | 925 | 591k | F: Parser<I, N, E>, | 926 | 591k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 591k | } |
nom::multi::length_data::<&[u8], u16, asn1_rs::error::Error, nom::number::streaming::be_u16<&[u8], asn1_rs::error::Error>> Line | Count | Source | 921 | 16 | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 16 | where | 923 | 16 | I: InputLength + InputTake, | 924 | 16 | N: ToUsize, | 925 | 16 | F: Parser<I, N, E>, | 926 | 16 | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 16 | } |
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 90 | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 90 | where | 923 | 90 | I: InputLength + InputTake, | 924 | 90 | N: ToUsize, | 925 | 90 | F: Parser<I, N, E>, | 926 | 90 | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 90 | } |
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 123 | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 123 | where | 923 | 123 | I: InputLength + InputTake, | 924 | 123 | N: ToUsize, | 925 | 123 | F: Parser<I, N, E>, | 926 | 123 | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 123 | } |
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 5.66k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 5.66k | where | 923 | 5.66k | I: InputLength + InputTake, | 924 | 5.66k | N: ToUsize, | 925 | 5.66k | F: Parser<I, N, E>, | 926 | 5.66k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 5.66k | } |
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _> nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u32<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 8.72k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 8.72k | where | 923 | 8.72k | I: InputLength + InputTake, | 924 | 8.72k | N: ToUsize, | 925 | 8.72k | F: Parser<I, N, E>, | 926 | 8.72k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 8.72k | } |
nom::multi::length_data::<&[u8], u16, asn1_rs::error::Error, nom::number::streaming::be_u16<&[u8], asn1_rs::error::Error>> Line | Count | Source | 921 | 6.97k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 6.97k | where | 923 | 6.97k | I: InputLength + InputTake, | 924 | 6.97k | N: ToUsize, | 925 | 6.97k | F: Parser<I, N, E>, | 926 | 6.97k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 6.97k | } |
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 234 | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 234 | where | 923 | 234 | I: InputLength + InputTake, | 924 | 234 | N: ToUsize, | 925 | 234 | F: Parser<I, N, E>, | 926 | 234 | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 234 | } |
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 2.72k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 2.72k | where | 923 | 2.72k | I: InputLength + InputTake, | 924 | 2.72k | N: ToUsize, | 925 | 2.72k | F: Parser<I, N, E>, | 926 | 2.72k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 2.72k | } |
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 921 | 14.3k | pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E> | 922 | 14.3k | where | 923 | 14.3k | I: InputLength + InputTake, | 924 | 14.3k | N: ToUsize, | 925 | 14.3k | F: Parser<I, N, E>, | 926 | 14.3k | E: ParseError<I>, | 927 | | { | 928 | | move |i: I| { | 929 | | let (i, length) = f.parse(i)?; | 930 | | | 931 | | let length: usize = length.to_usize(); | 932 | | | 933 | | if let Some(needed) = length | 934 | | .checked_sub(i.input_len()) | 935 | | .and_then(NonZeroUsize::new) | 936 | | { | 937 | | Err(Err::Incomplete(Needed::Size(needed))) | 938 | | } else { | 939 | | Ok(i.take_split(length)) | 940 | | } | 941 | | } | 942 | 14.3k | } |
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _> |
943 | | |
944 | | /// Gets a number from the first parser, |
945 | | /// takes a subslice of the input of that size, |
946 | | /// then applies the second parser on that subslice. |
947 | | /// If the second parser returns `Incomplete`, |
948 | | /// `length_value` will return an error. |
949 | | /// # Arguments |
950 | | /// * `f` The parser to apply. |
951 | | /// * `g` The parser to apply on the subslice. |
952 | | /// ```rust |
953 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
954 | | /// use nom::number::complete::be_u16; |
955 | | /// use nom::multi::length_value; |
956 | | /// use nom::bytes::complete::tag; |
957 | | /// |
958 | | /// fn parser(s: &[u8]) -> IResult<&[u8], &[u8]> { |
959 | | /// length_value(be_u16, tag("abc"))(s) |
960 | | /// } |
961 | | /// |
962 | | /// assert_eq!(parser(b"\x00\x03abcefg"), Ok((&b"efg"[..], &b"abc"[..]))); |
963 | | /// assert_eq!(parser(b"\x00\x03123123"), Err(Err::Error(Error::new(&b"123"[..], ErrorKind::Tag)))); |
964 | | /// assert_eq!(parser(b"\x00\x03a"), Err(Err::Incomplete(Needed::new(2)))); |
965 | | /// ``` |
966 | 0 | pub fn length_value<I, O, N, E, F, G>(mut f: F, mut g: G) -> impl FnMut(I) -> IResult<I, O, E> |
967 | 0 | where |
968 | 0 | I: Clone + InputLength + InputTake, |
969 | 0 | N: ToUsize, |
970 | 0 | F: Parser<I, N, E>, |
971 | 0 | G: Parser<I, O, E>, |
972 | 0 | E: ParseError<I>, |
973 | | { |
974 | 0 | move |i: I| { |
975 | 0 | let (i, length) = f.parse(i)?; |
976 | | |
977 | 0 | let length: usize = length.to_usize(); |
978 | | |
979 | 0 | if let Some(needed) = length |
980 | 0 | .checked_sub(i.input_len()) |
981 | 0 | .and_then(NonZeroUsize::new) |
982 | | { |
983 | 0 | Err(Err::Incomplete(Needed::Size(needed))) |
984 | | } else { |
985 | 0 | let (rest, i) = i.take_split(length); |
986 | 0 | match g.parse(i.clone()) { |
987 | 0 | Err(Err::Incomplete(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Complete))), |
988 | 0 | Err(e) => Err(e), |
989 | 0 | Ok((_, o)) => Ok((rest, o)), |
990 | | } |
991 | | } |
992 | 0 | } Unexecuted instantiation: nom::multi::length_value::<_, _, _, _, _, _>::{closure#0}Unexecuted instantiation: nom::multi::length_value::<_, _, _, _, _, _>::{closure#0} |
993 | 0 | } Unexecuted instantiation: nom::multi::length_value::<_, _, _, _, _, _> Unexecuted instantiation: nom::multi::length_value::<_, _, _, _, _, _> |
994 | | |
995 | | /// Gets a number from the first parser, |
996 | | /// then applies the second parser that many times. |
997 | | /// # Arguments |
998 | | /// * `f` The parser to apply to obtain the count. |
999 | | /// * `g` The parser to apply repeatedly. |
1000 | | /// ```rust |
1001 | | /// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult}; |
1002 | | /// use nom::number::complete::u8; |
1003 | | /// use nom::multi::length_count; |
1004 | | /// use nom::bytes::complete::tag; |
1005 | | /// use nom::combinator::map; |
1006 | | /// |
1007 | | /// fn parser(s: &[u8]) -> IResult<&[u8], Vec<&[u8]>> { |
1008 | | /// length_count(map(u8, |i| { |
1009 | | /// println!("got number: {}", i); |
1010 | | /// i |
1011 | | /// }), tag("abc"))(s) |
1012 | | /// } |
1013 | | /// |
1014 | | /// assert_eq!(parser(&b"\x02abcabcabc"[..]), Ok(((&b"abc"[..], vec![&b"abc"[..], &b"abc"[..]])))); |
1015 | | /// assert_eq!(parser(b"\x03123123123"), Err(Err::Error(Error::new(&b"123123123"[..], ErrorKind::Tag)))); |
1016 | | /// ``` |
1017 | | #[cfg(feature = "alloc")] |
1018 | 5.11k | pub fn length_count<I, O, N, E, F, G>(mut f: F, mut g: G) -> impl FnMut(I) -> IResult<I, Vec<O>, E> |
1019 | 5.11k | where |
1020 | 5.11k | I: Clone, |
1021 | 5.11k | N: ToUsize, |
1022 | 5.11k | F: Parser<I, N, E>, |
1023 | 5.11k | G: Parser<I, O, E>, |
1024 | 5.11k | E: ParseError<I>, |
1025 | | { |
1026 | 5.11k | move |i: I| { |
1027 | 5.11k | let (i, count) = f.parse(i)?; |
1028 | 5.07k | let mut input = i.clone(); |
1029 | 5.07k | let mut res = Vec::new(); |
1030 | | |
1031 | 5.07k | for _ in 0..count.to_usize() { |
1032 | 6.11k | let input_ = input.clone(); |
1033 | 6.11k | match g.parse(input_) { |
1034 | 5.72k | Ok((i, o)) => { |
1035 | 5.72k | res.push(o); |
1036 | 5.72k | input = i; |
1037 | 5.72k | } |
1038 | 0 | Err(Err::Error(e)) => { |
1039 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); |
1040 | | } |
1041 | 384 | Err(e) => { |
1042 | 384 | return Err(e); |
1043 | | } |
1044 | | } |
1045 | | } |
1046 | | |
1047 | 4.69k | Ok((input, res)) |
1048 | 5.11k | } nom::multi::length_count::<&[u8], u8, u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 1026 | 5.08k | move |i: I| { | 1027 | 5.08k | let (i, count) = f.parse(i)?; | 1028 | 5.04k | let mut input = i.clone(); | 1029 | 5.04k | let mut res = Vec::new(); | 1030 | | | 1031 | 5.04k | for _ in 0..count.to_usize() { | 1032 | 5.74k | let input_ = input.clone(); | 1033 | 5.74k | match g.parse(input_) { | 1034 | 5.37k | Ok((i, o)) => { | 1035 | 5.37k | res.push(o); | 1036 | 5.37k | input = i; | 1037 | 5.37k | } | 1038 | 0 | Err(Err::Error(e)) => { | 1039 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 1040 | | } | 1041 | 372 | Err(e) => { | 1042 | 372 | return Err(e); | 1043 | | } | 1044 | | } | 1045 | | } | 1046 | | | 1047 | 4.67k | Ok((input, res)) | 1048 | 5.08k | } |
Unexecuted instantiation: nom::multi::length_count::<_, _, _, _, _, _>::{closure#0}nom::multi::length_count::<&[u8], u8, u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>::{closure#0}Line | Count | Source | 1026 | 31 | move |i: I| { | 1027 | 31 | let (i, count) = f.parse(i)?; | 1028 | 29 | let mut input = i.clone(); | 1029 | 29 | let mut res = Vec::new(); | 1030 | | | 1031 | 29 | for _ in 0..count.to_usize() { | 1032 | 365 | let input_ = input.clone(); | 1033 | 365 | match g.parse(input_) { | 1034 | 353 | Ok((i, o)) => { | 1035 | 353 | res.push(o); | 1036 | 353 | input = i; | 1037 | 353 | } | 1038 | 0 | Err(Err::Error(e)) => { | 1039 | 0 | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 1040 | | } | 1041 | 12 | Err(e) => { | 1042 | 12 | return Err(e); | 1043 | | } | 1044 | | } | 1045 | | } | 1046 | | | 1047 | 17 | Ok((input, res)) | 1048 | 31 | } |
Unexecuted instantiation: nom::multi::length_count::<_, _, _, _, _, _>::{closure#0} |
1049 | 5.11k | } nom::multi::length_count::<&[u8], u8, u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 1018 | 5.08k | pub fn length_count<I, O, N, E, F, G>(mut f: F, mut g: G) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 1019 | 5.08k | where | 1020 | 5.08k | I: Clone, | 1021 | 5.08k | N: ToUsize, | 1022 | 5.08k | F: Parser<I, N, E>, | 1023 | 5.08k | G: Parser<I, O, E>, | 1024 | 5.08k | E: ParseError<I>, | 1025 | | { | 1026 | | move |i: I| { | 1027 | | let (i, count) = f.parse(i)?; | 1028 | | let mut input = i.clone(); | 1029 | | let mut res = Vec::new(); | 1030 | | | 1031 | | for _ in 0..count.to_usize() { | 1032 | | let input_ = input.clone(); | 1033 | | match g.parse(input_) { | 1034 | | Ok((i, o)) => { | 1035 | | res.push(o); | 1036 | | input = i; | 1037 | | } | 1038 | | Err(Err::Error(e)) => { | 1039 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 1040 | | } | 1041 | | Err(e) => { | 1042 | | return Err(e); | 1043 | | } | 1044 | | } | 1045 | | } | 1046 | | | 1047 | | Ok((input, res)) | 1048 | | } | 1049 | 5.08k | } |
Unexecuted instantiation: nom::multi::length_count::<_, _, _, _, _, _> nom::multi::length_count::<&[u8], u8, u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>> Line | Count | Source | 1018 | 31 | pub fn length_count<I, O, N, E, F, G>(mut f: F, mut g: G) -> impl FnMut(I) -> IResult<I, Vec<O>, E> | 1019 | 31 | where | 1020 | 31 | I: Clone, | 1021 | 31 | N: ToUsize, | 1022 | 31 | F: Parser<I, N, E>, | 1023 | 31 | G: Parser<I, O, E>, | 1024 | 31 | E: ParseError<I>, | 1025 | | { | 1026 | | move |i: I| { | 1027 | | let (i, count) = f.parse(i)?; | 1028 | | let mut input = i.clone(); | 1029 | | let mut res = Vec::new(); | 1030 | | | 1031 | | for _ in 0..count.to_usize() { | 1032 | | let input_ = input.clone(); | 1033 | | match g.parse(input_) { | 1034 | | Ok((i, o)) => { | 1035 | | res.push(o); | 1036 | | input = i; | 1037 | | } | 1038 | | Err(Err::Error(e)) => { | 1039 | | return Err(Err::Error(E::append(i, ErrorKind::Count, e))); | 1040 | | } | 1041 | | Err(e) => { | 1042 | | return Err(e); | 1043 | | } | 1044 | | } | 1045 | | } | 1046 | | | 1047 | | Ok((input, res)) | 1048 | | } | 1049 | 31 | } |
Unexecuted instantiation: nom::multi::length_count::<_, _, _, _, _, _> |