Coverage Report

Created: 2026-01-16 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/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
5.29M
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
5.29M
where
55
5.29M
  I: Clone + InputLength,
56
5.29M
  F: Parser<I, O, E>,
57
5.29M
  E: ParseError<I>,
58
{
59
5.24M
  move |mut i: I| {
60
5.24M
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
130M
      let len = i.input_len();
63
130M
      match f.parse(i.clone()) {
64
5.21M
        Err(Err::Error(_)) => return Ok((i, acc)),
65
33.0k
        Err(e) => return Err(e),
66
125M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
125M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
125M
          }
71
72
125M
          i = i1;
73
125M
          acc.push(o);
74
        }
75
      }
76
    }
77
5.24M
  }
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman>::{closure#0}
Line
Count
Source
59
1.12M
  move |mut i: I| {
60
1.12M
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
70.5M
      let len = i.input_len();
63
70.5M
      match f.parse(i.clone()) {
64
1.12M
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
69.4M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
69.4M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
69.4M
          }
71
72
69.4M
          i = i1;
73
69.4M
          acc.push(o);
74
        }
75
      }
76
    }
77
1.12M
  }
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
17.4k
  move |mut i: I| {
60
17.4k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
389k
      let len = i.input_len();
63
389k
      match f.parse(i.clone()) {
64
17.4k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
371k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
371k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
371k
          }
71
72
371k
          i = i1;
73
371k
          acc.push(o);
74
        }
75
      }
76
    }
77
17.4k
  }
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.3k
  move |mut i: I| {
60
18.3k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
723k
      let len = i.input_len();
63
723k
      match f.parse(i.clone()) {
64
18.3k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
704k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
704k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
704k
          }
71
72
704k
          i = i1;
73
704k
          acc.push(o);
74
        }
75
      }
76
    }
77
18.3k
  }
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
7.01k
  move |mut i: I| {
60
7.01k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
10.7k
      let len = i.input_len();
63
10.7k
      match f.parse(i.clone()) {
64
7.01k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
3.76k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
3.76k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
3.76k
          }
71
72
3.76k
          i = i1;
73
3.76k
          acc.push(o);
74
        }
75
      }
76
    }
77
7.01k
  }
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
12.0k
  move |mut i: I| {
60
12.0k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
14.3k
      let len = i.input_len();
63
14.3k
      match f.parse(i.clone()) {
64
12.0k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
2.33k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.33k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.33k
          }
71
72
2.33k
          i = i1;
73
2.33k
          acc.push(o);
74
        }
75
      }
76
    }
77
12.0k
  }
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
11.8k
  move |mut i: I| {
60
11.8k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
40.2k
      let len = i.input_len();
63
40.2k
      match f.parse(i.clone()) {
64
11.8k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
28.4k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
28.4k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
28.4k
          }
71
72
28.4k
          i = i1;
73
28.4k
          acc.push(o);
74
        }
75
      }
76
    }
77
11.8k
  }
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
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
  }
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
3.11k
  move |mut i: I| {
60
3.11k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
25.9k
      let len = i.input_len();
63
25.9k
      match f.parse(i.clone()) {
64
3.11k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
22.7k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
22.7k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
22.7k
          }
71
72
22.7k
          i = i1;
73
22.7k
          acc.push(o);
74
        }
75
      }
76
    }
77
3.11k
  }
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.75k
  move |mut i: I| {
60
2.75k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
7.38k
      let len = i.input_len();
63
7.38k
      match f.parse(i.clone()) {
64
2.73k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
24
        Err(e) => return Err(e),
66
4.63k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
4.63k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
4.63k
          }
71
72
4.63k
          i = i1;
73
4.63k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.75k
  }
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.89k
  move |mut i: I| {
60
1.89k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
4.48k
      let len = i.input_len();
63
4.48k
      match f.parse(i.clone()) {
64
1.88k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
7
        Err(e) => return Err(e),
66
2.58k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.58k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.58k
          }
71
72
2.58k
          i = i1;
73
2.58k
          acc.push(o);
74
        }
75
      }
76
    }
77
1.89k
  }
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.83k
  move |mut i: I| {
60
2.83k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
6.38k
      let len = i.input_len();
63
6.38k
      match f.parse(i.clone()) {
64
2.82k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
13
        Err(e) => return Err(e),
66
3.54k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
3.54k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
3.54k
          }
71
72
3.54k
          i = i1;
73
3.54k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.83k
  }
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.50k
  move |mut i: I| {
60
2.50k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
24.5k
      let len = i.input_len();
63
24.5k
      match f.parse(i.clone()) {
64
2.44k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
51
        Err(e) => return Err(e),
66
22.0k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
22.0k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
22.0k
          }
71
72
22.0k
          i = i1;
73
22.0k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.50k
  }
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
34.0k
  move |mut i: I| {
60
34.0k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
1.32M
      let len = i.input_len();
63
1.32M
      match f.parse(i.clone()) {
64
34.0k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
1.28M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
1.28M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
1.28M
          }
71
72
1.28M
          i = i1;
73
1.28M
          acc.push(o);
74
        }
75
      }
76
    }
77
34.0k
  }
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
229k
  move |mut i: I| {
60
229k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
572k
      let len = i.input_len();
63
572k
      match f.parse(i.clone()) {
64
229k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
342k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
342k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
342k
          }
71
72
342k
          i = i1;
73
342k
          acc.push(o);
74
        }
75
      }
76
    }
77
229k
  }
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
4.14k
  move |mut i: I| {
60
4.14k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
60.5k
      let len = i.input_len();
63
60.5k
      match f.parse(i.clone()) {
64
4.14k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
56.3k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
56.3k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
56.3k
          }
71
72
56.3k
          i = i1;
73
56.3k
          acc.push(o);
74
        }
75
      }
76
    }
77
4.14k
  }
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
6.42k
  move |mut i: I| {
60
6.42k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
398k
      let len = i.input_len();
63
398k
      match f.parse(i.clone()) {
64
6.42k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
392k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
392k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
392k
          }
71
72
392k
          i = i1;
73
392k
          acc.push(o);
74
        }
75
      }
76
    }
77
6.42k
  }
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
1.59k
  move |mut i: I| {
60
1.59k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
95.7k
      let len = i.input_len();
63
95.7k
      match f.parse(i.clone()) {
64
1.59k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
94.1k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
94.1k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
94.1k
          }
71
72
94.1k
          i = i1;
73
94.1k
          acc.push(o);
74
        }
75
      }
76
    }
77
1.59k
  }
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
4.84k
  move |mut i: I| {
60
4.84k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
116k
      let len = i.input_len();
63
116k
      match f.parse(i.clone()) {
64
4.84k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
111k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
111k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
111k
          }
71
72
111k
          i = i1;
73
111k
          acc.push(o);
74
        }
75
      }
76
    }
77
4.84k
  }
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
5.33k
  move |mut i: I| {
60
5.33k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
415k
      let len = i.input_len();
63
415k
      match f.parse(i.clone()) {
64
5.33k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
409k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
409k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
409k
          }
71
72
409k
          i = i1;
73
409k
          acc.push(o);
74
        }
75
      }
76
    }
77
5.33k
  }
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
20.4k
  move |mut i: I| {
60
20.4k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
35.4k
      let len = i.input_len();
63
35.4k
      match f.parse(i.clone()) {
64
20.2k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
241
        Err(e) => return Err(e),
66
14.9k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
14.9k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
14.9k
          }
71
72
14.9k
          i = i1;
73
14.9k
          acc.push(o);
74
        }
75
      }
76
    }
77
20.4k
  }
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
100
  move |mut i: I| {
60
100
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
190
      let len = i.input_len();
63
190
      match f.parse(i.clone()) {
64
95
        Err(Err::Error(_)) => return Ok((i, acc)),
65
5
        Err(e) => return Err(e),
66
90
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
90
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
90
          }
71
72
90
          i = i1;
73
90
          acc.push(o);
74
        }
75
      }
76
    }
77
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}>::{closure#0}
Line
Count
Source
59
11.4k
  move |mut i: I| {
60
11.4k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
14.5k
      let len = i.input_len();
63
14.5k
      match f.parse(i.clone()) {
64
5.51k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
5.89k
        Err(e) => return Err(e),
66
3.11k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
3.11k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
3.11k
          }
71
72
3.11k
          i = i1;
73
3.11k
          acc.push(o);
74
        }
75
      }
76
    }
77
11.4k
  }
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
5.01k
  move |mut i: I| {
60
5.01k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
8.72k
      let len = i.input_len();
63
8.72k
      match f.parse(i.clone()) {
64
5.01k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
3.71k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
3.71k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
3.71k
          }
71
72
3.71k
          i = i1;
73
3.71k
          acc.push(o);
74
        }
75
      }
76
    }
77
5.01k
  }
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
6.25k
  move |mut i: I| {
60
6.25k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
8.99k
      let len = i.input_len();
63
8.99k
      match f.parse(i.clone()) {
64
6.25k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
2.74k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.74k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.74k
          }
71
72
2.74k
          i = i1;
73
2.74k
          acc.push(o);
74
        }
75
      }
76
    }
77
6.25k
  }
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
4.79k
  move |mut i: I| {
60
4.79k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
7.53k
      let len = i.input_len();
63
7.53k
      match f.parse(i.clone()) {
64
4.79k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
2.74k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.74k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.74k
          }
71
72
2.74k
          i = i1;
73
2.74k
          acc.push(o);
74
        }
75
      }
76
    }
77
4.79k
  }
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
304k
  move |mut i: I| {
60
304k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
773k
      let len = i.input_len();
63
773k
      match f.parse(i.clone()) {
64
304k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
468k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
468k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
468k
          }
71
72
468k
          i = i1;
73
468k
          acc.push(o);
74
        }
75
      }
76
    }
77
304k
  }
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
170k
  move |mut i: I| {
60
170k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
2.23M
      let len = i.input_len();
63
2.23M
      match f.parse(i.clone()) {
64
170k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
2.06M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.06M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.06M
          }
71
72
2.06M
          i = i1;
73
2.06M
          acc.push(o);
74
        }
75
      }
76
    }
77
170k
  }
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
1.16M
  move |mut i: I| {
60
1.16M
    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
1.16M
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
733k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
733k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
733k
          }
71
72
733k
          i = i1;
73
733k
          acc.push(o);
74
        }
75
      }
76
    }
77
1.16M
  }
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman>::{closure#0}
Line
Count
Source
59
510k
  move |mut i: I| {
60
510k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
41.6M
      let len = i.input_len();
63
41.6M
      match f.parse(i.clone()) {
64
510k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
41.1M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
41.1M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
41.1M
          }
71
72
41.1M
          i = i1;
73
41.1M
          acc.push(o);
74
        }
75
      }
76
    }
77
510k
  }
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
3.87k
  move |mut i: I| {
60
3.87k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
106k
      let len = i.input_len();
63
106k
      match f.parse(i.clone()) {
64
3.87k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
102k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
102k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
102k
          }
71
72
102k
          i = i1;
73
102k
          acc.push(o);
74
        }
75
      }
76
    }
77
3.87k
  }
nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node6>::{closure#0}
Line
Count
Source
59
1.03k
  move |mut i: I| {
60
1.03k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
30.1k
      let len = i.input_len();
63
30.1k
      match f.parse(i.clone()) {
64
1.03k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
29.1k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
29.1k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
29.1k
          }
71
72
29.1k
          i = i1;
73
29.1k
          acc.push(o);
74
        }
75
      }
76
    }
77
1.03k
  }
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
908k
  move |mut i: I| {
60
908k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
1.16M
      let len = i.input_len();
63
1.16M
      match f.parse(i.clone()) {
64
908k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
251k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
251k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
251k
          }
71
72
251k
          i = i1;
73
251k
          acc.push(o);
74
        }
75
      }
76
    }
77
908k
  }
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
126k
  move |mut i: I| {
60
126k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
3.21M
      let len = i.input_len();
63
3.21M
      match f.parse(i.clone()) {
64
126k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
3.09M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
3.09M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
3.09M
          }
71
72
3.09M
          i = i1;
73
3.09M
          acc.push(o);
74
        }
75
      }
76
    }
77
126k
  }
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
12.9k
  move |mut i: I| {
60
12.9k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
430k
      let len = i.input_len();
63
430k
      match f.parse(i.clone()) {
64
12.9k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
417k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
417k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
417k
          }
71
72
417k
          i = i1;
73
417k
          acc.push(o);
74
        }
75
      }
76
    }
77
12.9k
  }
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
32.1k
  move |mut i: I| {
60
32.1k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
61.6k
      let len = i.input_len();
63
61.6k
      match f.parse(i.clone()) {
64
32.1k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
29.4k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
29.4k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
29.4k
          }
71
72
29.4k
          i = i1;
73
29.4k
          acc.push(o);
74
        }
75
      }
76
    }
77
32.1k
  }
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
10.7k
  move |mut i: I| {
60
10.7k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
33.6k
      let len = i.input_len();
63
33.6k
      match f.parse(i.clone()) {
64
10.7k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
22.8k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
22.8k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
22.8k
          }
71
72
22.8k
          i = i1;
73
22.8k
          acc.push(o);
74
        }
75
      }
76
    }
77
10.7k
  }
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
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], 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.47k
  move |mut i: I| {
60
2.47k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
21.1k
      let len = i.input_len();
63
21.1k
      match f.parse(i.clone()) {
64
2.47k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
18.7k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
18.7k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
18.7k
          }
71
72
18.7k
          i = i1;
73
18.7k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.47k
  }
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.10k
  move |mut i: I| {
60
2.10k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
5.69k
      let len = i.input_len();
63
5.69k
      match f.parse(i.clone()) {
64
2.02k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
79
        Err(e) => return Err(e),
66
3.59k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
3.59k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
3.59k
          }
71
72
3.59k
          i = i1;
73
3.59k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.10k
  }
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.86k
  move |mut i: I| {
60
1.86k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
4.13k
      let len = i.input_len();
63
4.13k
      match f.parse(i.clone()) {
64
1.83k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
27
        Err(e) => return Err(e),
66
2.27k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.27k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.27k
          }
71
72
2.27k
          i = i1;
73
2.27k
          acc.push(o);
74
        }
75
      }
76
    }
77
1.86k
  }
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.25k
  move |mut i: I| {
60
2.25k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
5.03k
      let len = i.input_len();
63
5.03k
      match f.parse(i.clone()) {
64
2.19k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
55
        Err(e) => return Err(e),
66
2.78k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.78k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.78k
          }
71
72
2.78k
          i = i1;
73
2.78k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.25k
  }
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.00k
  move |mut i: I| {
60
2.00k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
10.2k
      let len = i.input_len();
63
10.2k
      match f.parse(i.clone()) {
64
1.93k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
70
        Err(e) => return Err(e),
66
8.27k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
8.27k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
8.27k
          }
71
72
8.27k
          i = i1;
73
8.27k
          acc.push(o);
74
        }
75
      }
76
    }
77
2.00k
  }
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
44.0k
  move |mut i: I| {
60
44.0k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
2.26M
      let len = i.input_len();
63
2.26M
      match f.parse(i.clone()) {
64
44.0k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
2.22M
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
2.22M
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
2.22M
          }
71
72
2.22M
          i = i1;
73
2.22M
          acc.push(o);
74
        }
75
      }
76
    }
77
44.0k
  }
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
167k
  move |mut i: I| {
60
167k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
301k
      let len = i.input_len();
63
301k
      match f.parse(i.clone()) {
64
167k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
134k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
134k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
134k
          }
71
72
134k
          i = i1;
73
134k
          acc.push(o);
74
        }
75
      }
76
    }
77
167k
  }
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
5.68k
  move |mut i: I| {
60
5.68k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
237k
      let len = i.input_len();
63
237k
      match f.parse(i.clone()) {
64
5.68k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
231k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
231k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
231k
          }
71
72
231k
          i = i1;
73
231k
          acc.push(o);
74
        }
75
      }
76
    }
77
5.68k
  }
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
3.73k
  move |mut i: I| {
60
3.73k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
281k
      let len = i.input_len();
63
281k
      match f.parse(i.clone()) {
64
3.73k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
278k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
278k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
278k
          }
71
72
278k
          i = i1;
73
278k
          acc.push(o);
74
        }
75
      }
76
    }
77
3.73k
  }
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
1.85k
  move |mut i: I| {
60
1.85k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
51.7k
      let len = i.input_len();
63
51.7k
      match f.parse(i.clone()) {
64
1.85k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
49.9k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
49.9k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
49.9k
          }
71
72
49.9k
          i = i1;
73
49.9k
          acc.push(o);
74
        }
75
      }
76
    }
77
1.85k
  }
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
5.68k
  move |mut i: I| {
60
5.68k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
163k
      let len = i.input_len();
63
163k
      match f.parse(i.clone()) {
64
5.68k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
157k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
157k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
157k
          }
71
72
157k
          i = i1;
73
157k
          acc.push(o);
74
        }
75
      }
76
    }
77
5.68k
  }
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
6.60k
  move |mut i: I| {
60
6.60k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
528k
      let len = i.input_len();
63
528k
      match f.parse(i.clone()) {
64
6.60k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
522k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
522k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
522k
          }
71
72
522k
          i = i1;
73
522k
          acc.push(o);
74
        }
75
      }
76
    }
77
6.60k
  }
nom::multi::many0::<&[u8], kerberos_parser::krb5::HostAddress, der_parser::error::BerError, nom::combinator::complete<&[u8], kerberos_parser::krb5::HostAddress, der_parser::error::BerError, nom::combinator::cut<&[u8], kerberos_parser::krb5::HostAddress, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_krb5_hostaddress>::{closure#0}>::{closure#0}>::{closure#0}
Line
Count
Source
59
5.08k
  move |mut i: I| {
60
5.08k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
5.10k
      let len = i.input_len();
63
5.10k
      match f.parse(i.clone()) {
64
2.46k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
2.62k
        Err(e) => return Err(e),
66
20
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
20
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
20
          }
71
72
20
          i = i1;
73
20
          acc.push(o);
74
        }
75
      }
76
    }
77
5.08k
  }
nom::multi::many0::<&[u8], kerberos_parser::krb5::PAData, der_parser::error::BerError, nom::combinator::complete<&[u8], kerberos_parser::krb5::PAData, der_parser::error::BerError, nom::combinator::cut<&[u8], kerberos_parser::krb5::PAData, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_krb5_padata>::{closure#0}>::{closure#0}>::{closure#0}
Line
Count
Source
59
29.4k
  move |mut i: I| {
60
29.4k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
35.9k
      let len = i.input_len();
63
35.9k
      match f.parse(i.clone()) {
64
6.62k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
22.8k
        Err(e) => return Err(e),
66
6.49k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
6.49k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
6.49k
          }
71
72
6.49k
          i = i1;
73
6.49k
          acc.push(o);
74
        }
75
      }
76
    }
77
29.4k
  }
nom::multi::many0::<&[u8], alloc::string::String, der_parser::error::BerError, nom::combinator::complete<&[u8], alloc::string::String, der_parser::error::BerError, nom::combinator::cut<&[u8], alloc::string::String, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_kerberos_string>::{closure#0}>::{closure#0}>::{closure#0}
Line
Count
Source
59
10.6k
  move |mut i: I| {
60
10.6k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
16.1k
      let len = i.input_len();
63
16.1k
      match f.parse(i.clone()) {
64
9.88k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
804
        Err(e) => return Err(e),
66
5.45k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
5.45k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
5.45k
          }
71
72
5.45k
          i = i1;
73
5.45k
          acc.push(o);
74
        }
75
      }
76
    }
77
10.6k
  }
nom::multi::many0::<&[u8], i32, der_parser::error::BerError, nom::combinator::complete<&[u8], i32, der_parser::error::BerError, nom::combinator::cut<&[u8], i32, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_der_int32>::{closure#0}>::{closure#0}>::{closure#0}
Line
Count
Source
59
41.5k
  move |mut i: I| {
60
41.5k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
43.0k
      let len = i.input_len();
63
43.0k
      match f.parse(i.clone()) {
64
41.3k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
234
        Err(e) => return Err(e),
66
1.44k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
1.44k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
1.44k
          }
71
72
1.44k
          i = i1;
73
1.44k
          acc.push(o);
74
        }
75
      }
76
    }
77
41.5k
  }
nom::multi::many0::<&[u8], der_parser::ber::ber::BerObject, der_parser::error::BerError, nom::combinator::complete<&[u8], der_parser::ber::ber::BerObject, der_parser::error::BerError, der_parser::ber::parser::r_parse_ber::{closure#0}>::{closure#0}>::{closure#0}
Line
Count
Source
59
132k
  move |mut i: I| {
60
132k
    let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
61
    loop {
62
369k
      let len = i.input_len();
63
369k
      match f.parse(i.clone()) {
64
132k
        Err(Err::Error(_)) => return Ok((i, acc)),
65
0
        Err(e) => return Err(e),
66
236k
        Ok((i1, o)) => {
67
          // infinite loop check: the parser must always consume
68
236k
          if i1.input_len() == len {
69
0
            return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many0)));
70
236k
          }
71
72
236k
          i = i1;
73
236k
          acc.push(o);
74
        }
75
      }
76
    }
77
132k
  }
Unexecuted instantiation: nom::multi::many0::<_, _, _, _>::{closure#0}
78
5.29M
}
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
17.4k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
17.4k
where
55
17.4k
  I: Clone + InputLength,
56
17.4k
  F: Parser<I, O, E>,
57
17.4k
  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
17.4k
}
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.3k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
18.3k
where
55
18.3k
  I: Clone + InputLength,
56
18.3k
  F: Parser<I, O, E>,
57
18.3k
  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.3k
}
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman>
Line
Count
Source
53
1.12M
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
1.12M
where
55
1.12M
  I: Clone + InputLength,
56
1.12M
  F: Parser<I, O, E>,
57
1.12M
  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.12M
}
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
7.01k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
7.01k
where
55
7.01k
  I: Clone + InputLength,
56
7.01k
  F: Parser<I, O, E>,
57
7.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
7.01k
}
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
12.0k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
12.0k
where
55
12.0k
  I: Clone + InputLength,
56
12.0k
  F: Parser<I, O, E>,
57
12.0k
  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
12.0k
}
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
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], 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
6.55k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
6.55k
where
55
6.55k
  I: Clone + InputLength,
56
6.55k
  F: Parser<I, O, E>,
57
6.55k
  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.55k
}
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
6.39k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
6.39k
where
55
6.39k
  I: Clone + InputLength,
56
6.39k
  F: Parser<I, O, E>,
57
6.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
6.39k
}
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
11.8k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
11.8k
where
55
11.8k
  I: Clone + InputLength,
56
11.8k
  F: Parser<I, O, E>,
57
11.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
11.8k
}
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
3.11k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
3.11k
where
55
3.11k
  I: Clone + InputLength,
56
3.11k
  F: Parser<I, O, E>,
57
3.11k
  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.11k
}
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}>
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
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
}
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
7.07k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
7.07k
where
55
7.07k
  I: Clone + InputLength,
56
7.07k
  F: Parser<I, O, E>,
57
7.07k
  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.07k
}
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
34.0k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
34.0k
where
55
34.0k
  I: Clone + InputLength,
56
34.0k
  F: Parser<I, O, E>,
57
34.0k
  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
34.0k
}
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
2.13k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.13k
where
55
2.13k
  I: Clone + InputLength,
56
2.13k
  F: Parser<I, O, E>,
57
2.13k
  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.13k
}
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
5.15k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
5.15k
where
55
5.15k
  I: Clone + InputLength,
56
5.15k
  F: Parser<I, O, E>,
57
5.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
5.15k
}
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
14.6k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
14.6k
where
55
14.6k
  I: Clone + InputLength,
56
14.6k
  F: Parser<I, O, E>,
57
14.6k
  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.6k
}
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
13.7k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
13.7k
where
55
13.7k
  I: Clone + InputLength,
56
13.7k
  F: Parser<I, O, E>,
57
13.7k
  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.7k
}
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
229k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
229k
where
55
229k
  I: Clone + InputLength,
56
229k
  F: Parser<I, O, E>,
57
229k
  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
229k
}
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], 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
22.7k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
22.7k
where
55
22.7k
  I: Clone + InputLength,
56
22.7k
  F: Parser<I, O, E>,
57
22.7k
  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
22.7k
}
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
103
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
103
where
55
103
  I: Clone + InputLength,
56
103
  F: Parser<I, O, E>,
57
103
  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
103
}
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
15.2k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
15.2k
where
55
15.2k
  I: Clone + InputLength,
56
15.2k
  F: Parser<I, O, E>,
57
15.2k
  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.2k
}
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.76k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.76k
where
55
2.76k
  I: Clone + InputLength,
56
2.76k
  F: Parser<I, O, E>,
57
2.76k
  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.76k
}
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.89k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
1.89k
where
55
1.89k
  I: Clone + InputLength,
56
1.89k
  F: Parser<I, O, E>,
57
1.89k
  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.89k
}
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.84k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.84k
where
55
2.84k
  I: Clone + InputLength,
56
2.84k
  F: Parser<I, O, E>,
57
2.84k
  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.84k
}
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.50k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.50k
where
55
2.50k
  I: Clone + InputLength,
56
2.50k
  F: Parser<I, O, E>,
57
2.50k
  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.50k
}
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
304k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
304k
where
55
304k
  I: Clone + InputLength,
56
304k
  F: Parser<I, O, E>,
57
304k
  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
304k
}
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
170k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
170k
where
55
170k
  I: Clone + InputLength,
56
170k
  F: Parser<I, O, E>,
57
170k
  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
170k
}
nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node>
Line
Count
Source
53
3.88k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
3.88k
where
55
3.88k
  I: Clone + InputLength,
56
3.88k
  F: Parser<I, O, E>,
57
3.88k
  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.88k
}
nom::multi::many0::<&[u8], suricata::bittorrent_dht::parser::Node, nom::error::Error<&[u8]>, suricata::bittorrent_dht::parser::parse_node6>
Line
Count
Source
53
1.03k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
1.03k
where
55
1.03k
  I: Clone + InputLength,
56
1.03k
  F: Parser<I, O, E>,
57
1.03k
  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.03k
}
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
908k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
908k
where
55
908k
  I: Clone + InputLength,
56
908k
  F: Parser<I, O, E>,
57
908k
  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
908k
}
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
126k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
126k
where
55
126k
  I: Clone + InputLength,
56
126k
  F: Parser<I, O, E>,
57
126k
  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
126k
}
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
12.9k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
12.9k
where
55
12.9k
  I: Clone + InputLength,
56
12.9k
  F: Parser<I, O, E>,
57
12.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
12.9k
}
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
32.1k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
32.1k
where
55
32.1k
  I: Clone + InputLength,
56
32.1k
  F: Parser<I, O, E>,
57
32.1k
  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
32.1k
}
nom::multi::many0::<(&[u8], usize), u8, nom::error::Error<(&[u8], usize)>, suricata::http2::huffman::http2_decode_huffman>
Line
Count
Source
53
510k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
510k
where
55
510k
  I: Clone + InputLength,
56
510k
  F: Parser<I, O, E>,
57
510k
  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
510k
}
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
1.16M
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
1.16M
where
55
1.16M
  I: Clone + InputLength,
56
1.16M
  F: Parser<I, O, E>,
57
1.16M
  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.16M
}
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
10.7k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
10.7k
where
55
10.7k
  I: Clone + InputLength,
56
10.7k
  F: Parser<I, O, E>,
57
10.7k
  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
10.7k
}
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], 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
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
}
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
4.35k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
4.35k
where
55
4.35k
  I: Clone + InputLength,
56
4.35k
  F: Parser<I, O, E>,
57
4.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
4.35k
}
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
44.0k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
44.0k
where
55
44.0k
  I: Clone + InputLength,
56
44.0k
  F: Parser<I, O, E>,
57
44.0k
  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
44.0k
}
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
2.88k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.88k
where
55
2.88k
  I: Clone + InputLength,
56
2.88k
  F: Parser<I, O, E>,
57
2.88k
  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.88k
}
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
6.05k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
6.05k
where
55
6.05k
  I: Clone + InputLength,
56
6.05k
  F: Parser<I, O, E>,
57
6.05k
  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.05k
}
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
8.19k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
8.19k
where
55
8.19k
  I: Clone + InputLength,
56
8.19k
  F: Parser<I, O, E>,
57
8.19k
  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.19k
}
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
8.09k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
8.09k
where
55
8.09k
  I: Clone + InputLength,
56
8.09k
  F: Parser<I, O, E>,
57
8.09k
  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.09k
}
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
167k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
167k
where
55
167k
  I: Clone + InputLength,
56
167k
  F: Parser<I, O, E>,
57
167k
  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
167k
}
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], kerberos_parser::krb5::HostAddress, der_parser::error::BerError, nom::combinator::complete<&[u8], kerberos_parser::krb5::HostAddress, der_parser::error::BerError, nom::combinator::cut<&[u8], kerberos_parser::krb5::HostAddress, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_krb5_hostaddress>::{closure#0}>::{closure#0}>
Line
Count
Source
53
7.86k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
7.86k
where
55
7.86k
  I: Clone + InputLength,
56
7.86k
  F: Parser<I, O, E>,
57
7.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
7.86k
}
nom::multi::many0::<&[u8], kerberos_parser::krb5::PAData, der_parser::error::BerError, nom::combinator::complete<&[u8], kerberos_parser::krb5::PAData, der_parser::error::BerError, nom::combinator::cut<&[u8], kerberos_parser::krb5::PAData, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_krb5_padata>::{closure#0}>::{closure#0}>
Line
Count
Source
53
32.3k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
32.3k
where
55
32.3k
  I: Clone + InputLength,
56
32.3k
  F: Parser<I, O, E>,
57
32.3k
  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
32.3k
}
nom::multi::many0::<&[u8], alloc::string::String, der_parser::error::BerError, nom::combinator::complete<&[u8], alloc::string::String, der_parser::error::BerError, nom::combinator::cut<&[u8], alloc::string::String, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_kerberos_string>::{closure#0}>::{closure#0}>
Line
Count
Source
53
12.2k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
12.2k
where
55
12.2k
  I: Clone + InputLength,
56
12.2k
  F: Parser<I, O, E>,
57
12.2k
  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
12.2k
}
nom::multi::many0::<&[u8], i32, der_parser::error::BerError, nom::combinator::complete<&[u8], i32, der_parser::error::BerError, nom::combinator::cut<&[u8], i32, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_der_int32>::{closure#0}>::{closure#0}>
Line
Count
Source
53
43.3k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
43.3k
where
55
43.3k
  I: Clone + InputLength,
56
43.3k
  F: Parser<I, O, E>,
57
43.3k
  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
43.3k
}
nom::multi::many0::<&[u8], der_parser::ber::ber::BerObject, der_parser::error::BerError, nom::combinator::complete<&[u8], der_parser::ber::ber::BerObject, der_parser::error::BerError, der_parser::ber::parser::r_parse_ber::{closure#0}>::{closure#0}>
Line
Count
Source
53
132k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
132k
where
55
132k
  I: Clone + InputLength,
56
132k
  F: Parser<I, O, E>,
57
132k
  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
132k
}
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.10k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.10k
where
55
2.10k
  I: Clone + InputLength,
56
2.10k
  F: Parser<I, O, E>,
57
2.10k
  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.10k
}
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.87k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
1.87k
where
55
1.87k
  I: Clone + InputLength,
56
1.87k
  F: Parser<I, O, E>,
57
1.87k
  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.87k
}
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.27k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.27k
where
55
2.27k
  I: Clone + InputLength,
56
2.27k
  F: Parser<I, O, E>,
57
2.27k
  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.27k
}
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.00k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.00k
where
55
2.00k
  I: Clone + InputLength,
56
2.00k
  F: Parser<I, O, E>,
57
2.00k
  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.00k
}
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.47k
pub fn many0<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
54
2.47k
where
55
2.47k
  I: Clone + InputLength,
56
2.47k
  F: Parser<I, O, E>,
57
2.47k
  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.47k
}
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
1.22M
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
1.22M
where
110
1.22M
  I: Clone + InputLength,
111
1.22M
  F: Parser<I, O, E>,
112
1.22M
  E: ParseError<I>,
113
{
114
1.23M
  move |mut i: I| match f.parse(i.clone()) {
115
47.5k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
1.27k
    Err(e) => Err(e),
117
1.18M
    Ok((i1, o)) => {
118
1.18M
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.18M
      acc.push(o);
120
1.18M
      i = i1;
121
122
      loop {
123
9.16M
        let len = i.input_len();
124
9.16M
        match f.parse(i.clone()) {
125
1.14M
          Err(Err::Error(_)) => return Ok((i, acc)),
126
40.2k
          Err(e) => return Err(e),
127
7.98M
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
7.98M
            if i1.input_len() == len {
130
13
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
7.98M
            }
132
133
7.98M
            i = i1;
134
7.98M
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
1.23M
  }
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
4.60k
  move |mut i: I| match f.parse(i.clone()) {
115
128
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
4.48k
    Ok((i1, o)) => {
118
4.48k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
4.48k
      acc.push(o);
120
4.48k
      i = i1;
121
122
      loop {
123
1.03M
        let len = i.input_len();
124
1.03M
        match f.parse(i.clone()) {
125
4.48k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
1.02M
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
1.02M
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
1.02M
            }
132
133
1.02M
            i = i1;
134
1.02M
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
4.60k
  }
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
111k
  move |mut i: I| match f.parse(i.clone()) {
115
9.76k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
101k
    Ok((i1, o)) => {
118
101k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
101k
      acc.push(o);
120
101k
      i = i1;
121
122
      loop {
123
219k
        let len = i.input_len();
124
219k
        match f.parse(i.clone()) {
125
101k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
117k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
117k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
117k
            }
132
133
117k
            i = i1;
134
117k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
111k
  }
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
10.1k
  move |mut i: I| match f.parse(i.clone()) {
115
3.59k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
6.53k
    Ok((i1, o)) => {
118
6.53k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
6.53k
      acc.push(o);
120
6.53k
      i = i1;
121
122
      loop {
123
14.7k
        let len = i.input_len();
124
14.7k
        match f.parse(i.clone()) {
125
6.53k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
8.25k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
8.25k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
8.25k
            }
132
133
8.25k
            i = i1;
134
8.25k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
10.1k
  }
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
3.33k
  move |mut i: I| match f.parse(i.clone()) {
115
596
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
2.74k
    Ok((i1, o)) => {
118
2.74k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
2.74k
      acc.push(o);
120
2.74k
      i = i1;
121
122
      loop {
123
4.41k
        let len = i.input_len();
124
4.41k
        match f.parse(i.clone()) {
125
2.74k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
1.67k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
1.67k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
1.67k
            }
132
133
1.67k
            i = i1;
134
1.67k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
3.33k
  }
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::Filter as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>::{closure#0}
Line
Count
Source
114
10.9k
  move |mut i: I| match f.parse(i.clone()) {
115
826
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
10.1k
    Ok((i1, o)) => {
118
10.1k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
10.1k
      acc.push(o);
120
10.1k
      i = i1;
121
122
      loop {
123
13.4k
        let len = i.input_len();
124
13.4k
        match f.parse(i.clone()) {
125
10.1k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
3.28k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
3.28k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
3.28k
            }
132
133
3.28k
            i = i1;
134
3.28k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
10.9k
  }
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
29.3k
  move |mut i: I| match f.parse(i.clone()) {
115
944
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
28.4k
    Ok((i1, o)) => {
118
28.4k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
28.4k
      acc.push(o);
120
28.4k
      i = i1;
121
122
      loop {
123
28.4k
        let len = i.input_len();
124
28.4k
        match f.parse(i.clone()) {
125
28.4k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
21
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
21
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
21
            }
132
133
21
            i = i1;
134
21
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
29.3k
  }
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.76k
  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
1.75k
    Ok((i1, o)) => {
118
1.75k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.75k
      acc.push(o);
120
1.75k
      i = i1;
121
122
      loop {
123
2.71k
        let len = i.input_len();
124
2.71k
        match f.parse(i.clone()) {
125
1.75k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
958
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
958
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
958
            }
132
133
958
            i = i1;
134
958
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
1.76k
  }
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.04k
  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.03k
    Ok((i1, o)) => {
118
1.03k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.03k
      acc.push(o);
120
1.03k
      i = i1;
121
122
      loop {
123
3.09k
        let len = i.input_len();
124
3.09k
        match f.parse(i.clone()) {
125
1.03k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
2.05k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
2.05k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
2.05k
            }
132
133
2.05k
            i = i1;
134
2.05k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
1.04k
  }
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
3.17k
  move |mut i: I| match f.parse(i.clone()) {
115
10
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
3.16k
    Ok((i1, o)) => {
118
3.16k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
3.16k
      acc.push(o);
120
3.16k
      i = i1;
121
122
      loop {
123
47.4k
        let len = i.input_len();
124
47.4k
        match f.parse(i.clone()) {
125
3.16k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
44.2k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
44.2k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
44.2k
            }
132
133
44.2k
            i = i1;
134
44.2k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
3.17k
  }
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
381k
  move |mut i: I| match f.parse(i.clone()) {
115
434
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
381k
    Ok((i1, o)) => {
118
381k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
381k
      acc.push(o);
120
381k
      i = i1;
121
122
      loop {
123
409k
        let len = i.input_len();
124
409k
        match f.parse(i.clone()) {
125
381k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
28.4k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
28.4k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
28.4k
            }
132
133
28.4k
            i = i1;
134
28.4k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
381k
  }
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
5
  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
5
    Ok((i1, o)) => {
118
5
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
5
      acc.push(o);
120
5
      i = i1;
121
122
      loop {
123
5
        let len = i.input_len();
124
5
        match f.parse(i.clone()) {
125
0
          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
5
              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
5
  }
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
19.2k
  move |mut i: I| match f.parse(i.clone()) {
115
18
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
19.2k
    Ok((i1, o)) => {
118
19.2k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
19.2k
      acc.push(o);
120
19.2k
      i = i1;
121
122
      loop {
123
54.8k
        let len = i.input_len();
124
54.8k
        match f.parse(i.clone()) {
125
19.2k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
35.6k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
35.6k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
35.6k
            }
132
133
35.6k
            i = i1;
134
35.6k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
19.2k
  }
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
14.6k
  move |mut i: I| match f.parse(i.clone()) {
115
35
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
14.6k
    Ok((i1, o)) => {
118
14.6k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
14.6k
      acc.push(o);
120
14.6k
      i = i1;
121
122
      loop {
123
17.4k
        let len = i.input_len();
124
17.4k
        match f.parse(i.clone()) {
125
14.6k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
2.86k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
2.86k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
2.86k
            }
132
133
2.86k
            i = i1;
134
2.86k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
14.6k
  }
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
3.05k
  move |mut i: I| match f.parse(i.clone()) {
115
47
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
3.00k
    Ok((i1, o)) => {
118
3.00k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
3.00k
      acc.push(o);
120
3.00k
      i = i1;
121
122
      loop {
123
4.27k
        let len = i.input_len();
124
4.27k
        match f.parse(i.clone()) {
125
3.00k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
1.26k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
1.26k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
1.26k
            }
132
133
1.26k
            i = i1;
134
1.26k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
3.05k
  }
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
2.55k
  move |mut i: I| match f.parse(i.clone()) {
115
742
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
1.81k
    Ok((i1, o)) => {
118
1.81k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.81k
      acc.push(o);
120
1.81k
      i = i1;
121
122
      loop {
123
6.70k
        let len = i.input_len();
124
6.70k
        match f.parse(i.clone()) {
125
1.81k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
4.89k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
4.89k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
4.89k
            }
132
133
4.89k
            i = i1;
134
4.89k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
2.55k
  }
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.52k
  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
3.50k
    Ok((i1, o)) => {
118
3.50k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
3.50k
      acc.push(o);
120
3.50k
      i = i1;
121
122
      loop {
123
3.51k
        let len = i.input_len();
124
3.51k
        match f.parse(i.clone()) {
125
3.50k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
11
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
11
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
11
            }
132
133
11
            i = i1;
134
11
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
3.52k
  }
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
153k
  move |mut i: I| match f.parse(i.clone()) {
115
216
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
152k
    Ok((i1, o)) => {
118
152k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
152k
      acc.push(o);
120
152k
      i = i1;
121
122
      loop {
123
414k
        let len = i.input_len();
124
414k
        match f.parse(i.clone()) {
125
152k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
261k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
261k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
261k
            }
132
133
261k
            i = i1;
134
261k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
153k
  }
nom::multi::many1::<&[u8], suricata::pgsql::parser::PgsqlParameter, nom::error::Error<&[u8]>, suricata::pgsql::parser::pgsql_parse_generic_parameter>::{closure#0}
Line
Count
Source
114
104k
  move |mut i: I| match f.parse(i.clone()) {
115
18
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
1.27k
    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.35M
        let len = i.input_len();
124
2.35M
        match f.parse(i.clone()) {
125
63.1k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
40.2k
          Err(e) => return Err(e),
127
2.24M
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
2.24M
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
2.24M
            }
132
133
2.24M
            i = i1;
134
2.24M
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
104k
  }
nom::multi::many1::<&[u8], suricata::pgsql::parser::SASLAuthenticationMechanism, nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_sasl_mechanism>::{closure#0}
Line
Count
Source
114
1.78k
  move |mut i: I| match f.parse(i.clone()) {
115
59
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
1.72k
    Ok((i1, o)) => {
118
1.72k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.72k
      acc.push(o);
120
1.72k
      i = i1;
121
122
      loop {
123
4.47k
        let len = i.input_len();
124
4.47k
        match f.parse(i.clone()) {
125
1.72k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
2.75k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
2.75k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
2.75k
            }
132
133
2.75k
            i = i1;
134
2.75k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
1.78k
  }
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
18.8k
  move |mut i: I| match f.parse(i.clone()) {
115
2.03k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
16.8k
    Ok((i1, o)) => {
118
16.8k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
16.8k
      acc.push(o);
120
16.8k
      i = i1;
121
122
      loop {
123
27.1k
        let len = i.input_len();
124
27.1k
        match f.parse(i.clone()) {
125
16.8k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
10.3k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
10.3k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
10.3k
            }
132
133
10.3k
            i = i1;
134
10.3k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
18.8k
  }
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
17.4k
  move |mut i: I| match f.parse(i.clone()) {
115
2.09k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
15.3k
    Ok((i1, o)) => {
118
15.3k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
15.3k
      acc.push(o);
120
15.3k
      i = i1;
121
122
      loop {
123
917k
        let len = i.input_len();
124
917k
        match f.parse(i.clone()) {
125
15.3k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
901k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
901k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
901k
            }
132
133
901k
            i = i1;
134
901k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
17.4k
  }
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
1.93k
  move |mut i: I| match f.parse(i.clone()) {
115
893
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
1.04k
    Ok((i1, o)) => {
118
1.04k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.04k
      acc.push(o);
120
1.04k
      i = i1;
121
122
      loop {
123
1.18k
        let len = i.input_len();
124
1.18k
        match f.parse(i.clone()) {
125
1.04k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
143
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
143
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
143
            }
132
133
143
            i = i1;
134
143
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
1.93k
  }
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
5.45k
  move |mut i: I| match f.parse(i.clone()) {
115
153
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
5.30k
    Ok((i1, o)) => {
118
5.30k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
5.30k
      acc.push(o);
120
5.30k
      i = i1;
121
122
      loop {
123
2.54M
        let len = i.input_len();
124
2.54M
        match f.parse(i.clone()) {
125
5.30k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
2.54M
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
2.54M
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
2.54M
            }
132
133
2.54M
            i = i1;
134
2.54M
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
5.45k
  }
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
33.6k
  move |mut i: I| match f.parse(i.clone()) {
115
11.5k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
22.1k
    Ok((i1, o)) => {
118
22.1k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
22.1k
      acc.push(o);
120
22.1k
      i = i1;
121
122
      loop {
123
62.3k
        let len = i.input_len();
124
62.3k
        match f.parse(i.clone()) {
125
22.1k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
40.2k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
40.2k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
40.2k
            }
132
133
40.2k
            i = i1;
134
40.2k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
33.6k
  }
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
12.2k
  move |mut i: I| match f.parse(i.clone()) {
115
5.76k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
6.45k
    Ok((i1, o)) => {
118
6.45k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
6.45k
      acc.push(o);
120
6.45k
      i = i1;
121
122
      loop {
123
12.6k
        let len = i.input_len();
124
12.6k
        match f.parse(i.clone()) {
125
6.45k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
6.18k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
6.18k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
6.18k
            }
132
133
6.18k
            i = i1;
134
6.18k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
12.2k
  }
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
24.0k
  move |mut i: I| match f.parse(i.clone()) {
115
1.17k
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
22.8k
    Ok((i1, o)) => {
118
22.8k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
22.8k
      acc.push(o);
120
22.8k
      i = i1;
121
122
      loop {
123
22.8k
        let len = i.input_len();
124
22.8k
        match f.parse(i.clone()) {
125
22.8k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
11
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
11
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
11
            }
132
133
11
            i = i1;
134
11
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
24.0k
  }
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.80k
  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
1.80k
    Ok((i1, o)) => {
118
1.80k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
1.80k
      acc.push(o);
120
1.80k
      i = i1;
121
122
      loop {
123
2.87k
        let len = i.input_len();
124
2.87k
        match f.parse(i.clone()) {
125
1.80k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
1.07k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
1.07k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
1.07k
            }
132
133
1.07k
            i = i1;
134
1.07k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
1.80k
  }
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
998
  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
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
2.91k
        let len = i.input_len();
124
2.91k
        match f.parse(i.clone()) {
125
991
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
1.92k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
1.92k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
1.92k
            }
132
133
1.92k
            i = i1;
134
1.92k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
998
  }
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
17.4k
  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
17.4k
    Ok((i1, o)) => {
118
17.4k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
17.4k
      acc.push(o);
120
17.4k
      i = i1;
121
122
      loop {
123
614k
        let len = i.input_len();
124
614k
        match f.parse(i.clone()) {
125
17.4k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
597k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
597k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
597k
            }
132
133
597k
            i = i1;
134
597k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
17.4k
  }
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
227k
  move |mut i: I| match f.parse(i.clone()) {
115
412
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
226k
    Ok((i1, o)) => {
118
226k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
226k
      acc.push(o);
120
226k
      i = i1;
121
122
      loop {
123
296k
        let len = i.input_len();
124
296k
        match f.parse(i.clone()) {
125
226k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
69.4k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
69.4k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
69.4k
            }
132
133
69.4k
            i = i1;
134
69.4k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
227k
  }
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
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
0
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
8
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
8
            if i1.input_len() == len {
130
8
              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], 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
3.22k
  move |mut i: I| match f.parse(i.clone()) {
115
28
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
3.19k
    Ok((i1, o)) => {
118
3.19k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
3.19k
      acc.push(o);
120
3.19k
      i = i1;
121
122
      loop {
123
24.6k
        let len = i.input_len();
124
24.6k
        match f.parse(i.clone()) {
125
3.19k
          Err(Err::Error(_)) => return Ok((i, acc)),
126
0
          Err(e) => return Err(e),
127
21.4k
          Ok((i1, o)) => {
128
            // infinite loop check: the parser must always consume
129
21.4k
            if i1.input_len() == len {
130
0
              return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1)));
131
21.4k
            }
132
133
21.4k
            i = i1;
134
21.4k
            acc.push(o);
135
          }
136
        }
137
      }
138
    }
139
3.22k
  }
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], kerberos_parser::krb5::Ticket, der_parser::error::BerError, nom::combinator::complete<&[u8], kerberos_parser::krb5::Ticket, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_krb5_ticket>::{closure#0}>::{closure#0}
Line
Count
Source
114
5.97k
  move |mut i: I| match f.parse(i.clone()) {
115
5.97k
    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
5.97k
  }
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
2.72k
  move |mut i: I| match f.parse(i.clone()) {
115
75
    Err(Err::Error(err)) => Err(Err::Error(E::append(i, ErrorKind::Many1, err))),
116
0
    Err(e) => Err(e),
117
2.65k
    Ok((i1, o)) => {
118
2.65k
      let mut acc = crate::lib::std::vec::Vec::with_capacity(4);
119
2.65k
      acc.push(o);
120
2.65k
      i = i1;
121
122
      loop {
123
2.65k
        let len = i.input_len();
124
2.65k
        match f.parse(i.clone()) {
125
2.65k
          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
2.72k
  }
140
1.22M
}
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
4.60k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
4.60k
where
110
4.60k
  I: Clone + InputLength,
111
4.60k
  F: Parser<I, O, E>,
112
4.60k
  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
4.60k
}
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
111k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
111k
where
110
111k
  I: Clone + InputLength,
111
111k
  F: Parser<I, O, E>,
112
111k
  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
111k
}
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
10.1k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
10.1k
where
110
10.1k
  I: Clone + InputLength,
111
10.1k
  F: Parser<I, O, E>,
112
10.1k
  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
10.1k
}
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
3.33k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
3.33k
where
110
3.33k
  I: Clone + InputLength,
111
3.33k
  F: Parser<I, O, E>,
112
3.33k
  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.33k
}
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
15.1k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
15.1k
where
110
15.1k
  I: Clone + InputLength,
111
15.1k
  F: Parser<I, O, E>,
112
15.1k
  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.1k
}
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::Filter as asn1_rs::traits::FromBer<ldap_parser::error::LdapError>>::from_ber>::{closure#0}>
Line
Count
Source
108
10.9k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
10.9k
where
110
10.9k
  I: Clone + InputLength,
111
10.9k
  F: Parser<I, O, E>,
112
10.9k
  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
10.9k
}
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
29.3k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
29.3k
where
110
29.3k
  I: Clone + InputLength,
111
29.3k
  F: Parser<I, O, E>,
112
29.3k
  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
29.3k
}
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.76k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
1.76k
where
110
1.76k
  I: Clone + InputLength,
111
1.76k
  F: Parser<I, O, E>,
112
1.76k
  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.76k
}
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.04k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
1.04k
where
110
1.04k
  I: Clone + InputLength,
111
1.04k
  F: Parser<I, O, E>,
112
1.04k
  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.04k
}
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
3.17k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
3.17k
where
110
3.17k
  I: Clone + InputLength,
111
3.17k
  F: Parser<I, O, E>,
112
3.17k
  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.17k
}
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
381k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
381k
where
110
381k
  I: Clone + InputLength,
111
381k
  F: Parser<I, O, E>,
112
381k
  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
381k
}
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
5
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
5
where
110
5
  I: Clone + InputLength,
111
5
  F: Parser<I, O, E>,
112
5
  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
}
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
19.2k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
19.2k
where
110
19.2k
  I: Clone + InputLength,
111
19.2k
  F: Parser<I, O, E>,
112
19.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
19.2k
}
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
3.30k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
3.30k
where
110
3.30k
  I: Clone + InputLength,
111
3.30k
  F: Parser<I, O, E>,
112
3.30k
  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.30k
}
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
2.55k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
2.55k
where
110
2.55k
  I: Clone + InputLength,
111
2.55k
  F: Parser<I, O, E>,
112
2.55k
  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.55k
}
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.52k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
3.52k
where
110
3.52k
  I: Clone + InputLength,
111
3.52k
  F: Parser<I, O, E>,
112
3.52k
  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.52k
}
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
153k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
153k
where
110
153k
  I: Clone + InputLength,
111
153k
  F: Parser<I, O, E>,
112
153k
  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
153k
}
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
17.4k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
17.4k
where
110
17.4k
  I: Clone + InputLength,
111
17.4k
  F: Parser<I, O, E>,
112
17.4k
  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
17.4k
}
nom::multi::many1::<&str, kerberos_parser::krb5_constants::EncryptionType, nom::error::Error<&str>, suricata::krb::detect::detect_parse_encryption_item>
Line
Count
Source
108
1.93k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
1.93k
where
110
1.93k
  I: Clone + InputLength,
111
1.93k
  F: Parser<I, O, E>,
112
1.93k
  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.93k
}
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.61k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
7.61k
where
110
7.61k
  I: Clone + InputLength,
111
7.61k
  F: Parser<I, O, E>,
112
7.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
7.61k
}
nom::multi::many1::<&[u8], suricata::pgsql::parser::PgsqlParameter, nom::error::Error<&[u8]>, suricata::pgsql::parser::pgsql_parse_generic_parameter>
Line
Count
Source
108
104k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
104k
where
110
104k
  I: Clone + InputLength,
111
104k
  F: Parser<I, O, E>,
112
104k
  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
104k
}
nom::multi::many1::<&[u8], suricata::pgsql::parser::SASLAuthenticationMechanism, nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_sasl_mechanism>
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], 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
5.45k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
5.45k
where
110
5.45k
  I: Clone + InputLength,
111
5.45k
  F: Parser<I, O, E>,
112
5.45k
  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.45k
}
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
33.6k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
33.6k
where
110
33.6k
  I: Clone + InputLength,
111
33.6k
  F: Parser<I, O, E>,
112
33.6k
  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
33.6k
}
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
12.2k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
12.2k
where
110
12.2k
  I: Clone + InputLength,
111
12.2k
  F: Parser<I, O, E>,
112
12.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
12.2k
}
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
24.0k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
24.0k
where
110
24.0k
  I: Clone + InputLength,
111
24.0k
  F: Parser<I, O, E>,
112
24.0k
  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
24.0k
}
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.80k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
1.80k
where
110
1.80k
  I: Clone + InputLength,
111
1.80k
  F: Parser<I, O, E>,
112
1.80k
  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.80k
}
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
999
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
999
where
110
999
  I: Clone + InputLength,
111
999
  F: Parser<I, O, E>,
112
999
  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
999
}
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
17.4k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
17.4k
where
110
17.4k
  I: Clone + InputLength,
111
17.4k
  F: Parser<I, O, E>,
112
17.4k
  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
17.4k
}
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
227k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
227k
where
110
227k
  I: Clone + InputLength,
111
227k
  F: Parser<I, O, E>,
112
227k
  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
227k
}
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
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], 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
3.22k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
3.22k
where
110
3.22k
  I: Clone + InputLength,
111
3.22k
  F: Parser<I, O, E>,
112
3.22k
  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.22k
}
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], kerberos_parser::krb5::Ticket, der_parser::error::BerError, nom::combinator::complete<&[u8], kerberos_parser::krb5::Ticket, der_parser::error::BerError, kerberos_parser::krb5_parser::parse_krb5_ticket>::{closure#0}>
Line
Count
Source
108
5.97k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
5.97k
where
110
5.97k
  I: Clone + InputLength,
111
5.97k
  F: Parser<I, O, E>,
112
5.97k
  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.97k
}
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
2.72k
pub fn many1<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
109
2.72k
where
110
2.72k
  I: Clone + InputLength,
111
2.72k
  F: Parser<I, O, E>,
112
2.72k
  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.72k
}
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
395k
pub fn many_till<I, O, P, E, F, G>(
166
395k
  mut f: F,
167
395k
  mut g: G,
168
395k
) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E>
169
395k
where
170
395k
  I: Clone + InputLength,
171
395k
  F: Parser<I, O, E>,
172
395k
  G: Parser<I, P, E>,
173
395k
  E: ParseError<I>,
174
{
175
395k
  move |mut i: I| {
176
395k
    let mut res = crate::lib::std::vec::Vec::new();
177
    loop {
178
15.7M
      let len = i.input_len();
179
15.7M
      match g.parse(i.clone()) {
180
56.2k
        Ok((i1, o)) => return Ok((i1, (res, o))),
181
        Err(Err::Error(_)) => {
182
15.6M
          match f.parse(i.clone()) {
183
293k
            Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))),
184
31.8k
            Err(e) => return Err(e),
185
15.3M
            Ok((i1, o)) => {
186
              // infinite loop check: the parser must always consume
187
15.3M
              if i1.input_len() == len {
188
0
                return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill)));
189
15.3M
              }
190
191
15.3M
              res.push(o);
192
15.3M
              i = i1;
193
            }
194
          }
195
        }
196
13.4k
        Err(e) => return Err(e),
197
      }
198
    }
199
395k
  }
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
5.00k
  move |mut i: I| {
176
5.00k
    let mut res = crate::lib::std::vec::Vec::new();
177
    loop {
178
7.07k
      let len = i.input_len();
179
7.07k
      match g.parse(i.clone()) {
180
2.40k
        Ok((i1, o)) => return Ok((i1, (res, o))),
181
        Err(Err::Error(_)) => {
182
3.84k
          match f.parse(i.clone()) {
183
1.77k
            Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))),
184
0
            Err(e) => return Err(e),
185
2.07k
            Ok((i1, o)) => {
186
              // infinite loop check: the parser must always consume
187
2.07k
              if i1.input_len() == len {
188
0
                return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill)));
189
2.07k
              }
190
191
2.07k
              res.push(o);
192
2.07k
              i = i1;
193
            }
194
          }
195
        }
196
829
        Err(e) => return Err(e),
197
      }
198
    }
199
5.00k
  }
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
267k
  move |mut i: I| {
176
267k
    let mut res = crate::lib::std::vec::Vec::new();
177
    loop {
178
14.6M
      let len = i.input_len();
179
14.6M
      match g.parse(i.clone()) {
180
16.8k
        Ok((i1, o)) => return Ok((i1, (res, o))),
181
        Err(Err::Error(_)) => {
182
14.6M
          match f.parse(i.clone()) {
183
250k
            Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))),
184
0
            Err(e) => return Err(e),
185
14.3M
            Ok((i1, o)) => {
186
              // infinite loop check: the parser must always consume
187
14.3M
              if i1.input_len() == len {
188
0
                return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill)));
189
14.3M
              }
190
191
14.3M
              res.push(o);
192
14.3M
              i = i1;
193
            }
194
          }
195
        }
196
0
        Err(e) => return Err(e),
197
      }
198
    }
199
267k
  }
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
5.82k
  move |mut i: I| {
176
5.82k
    let mut res = crate::lib::std::vec::Vec::new();
177
    loop {
178
9.45k
      let len = i.input_len();
179
9.45k
      match g.parse(i.clone()) {
180
2.82k
        Ok((i1, o)) => return Ok((i1, (res, o))),
181
        Err(Err::Error(_)) => {
182
6.12k
          match f.parse(i.clone()) {
183
2.49k
            Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))),
184
0
            Err(e) => return Err(e),
185
3.62k
            Ok((i1, o)) => {
186
              // infinite loop check: the parser must always consume
187
3.62k
              if i1.input_len() == len {
188
0
                return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill)));
189
3.62k
              }
190
191
3.62k
              res.push(o);
192
3.62k
              i = i1;
193
            }
194
          }
195
        }
196
507
        Err(e) => return Err(e),
197
      }
198
    }
199
5.82k
  }
nom::multi::many_till::<&[u8], suricata::pgsql::parser::PgsqlErrorNoticeMessageField, &[u8], nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_error_notice_fields::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>::{closure#0}
Line
Count
Source
175
35.3k
  move |mut i: I| {
176
35.3k
    let mut res = crate::lib::std::vec::Vec::new();
177
    loop {
178
887k
      let len = i.input_len();
179
887k
      match g.parse(i.clone()) {
180
15.3k
        Ok((i1, o)) => return Ok((i1, (res, o))),
181
        Err(Err::Error(_)) => {
182
868k
          match f.parse(i.clone()) {
183
276
            Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))),
184
15.9k
            Err(e) => return Err(e),
185
852k
            Ok((i1, o)) => {
186
              // infinite loop check: the parser must always consume
187
852k
              if i1.input_len() == len {
188
0
                return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill)));
189
852k
              }
190
191
852k
              res.push(o);
192
852k
              i = i1;
193
            }
194
          }
195
        }
196
3.85k
        Err(e) => return Err(e),
197
      }
198
    }
199
35.3k
  }
nom::multi::many_till::<&[u8], der_parser::ber::ber::BerObject, der_parser::ber::ber::BerObject, der_parser::error::BerError, der_parser::ber::parser::r_parse_ber::{closure#0}, der_parser::ber::parser::parse_ber_endofcontent>::{closure#0}
Line
Count
Source
175
81.3k
  move |mut i: I| {
176
81.3k
    let mut res = crate::lib::std::vec::Vec::new();
177
    loop {
178
183k
      let len = i.input_len();
179
183k
      match g.parse(i.clone()) {
180
18.8k
        Ok((i1, o)) => return Ok((i1, (res, o))),
181
        Err(Err::Error(_)) => {
182
156k
          match f.parse(i.clone()) {
183
38.3k
            Err(Err::Error(err)) => return Err(Err::Error(E::append(i, ErrorKind::ManyTill, err))),
184
15.9k
            Err(e) => return Err(e),
185
102k
            Ok((i1, o)) => {
186
              // infinite loop check: the parser must always consume
187
102k
              if i1.input_len() == len {
188
0
                return Err(Err::Error(E::from_error_kind(i1, ErrorKind::ManyTill)));
189
102k
              }
190
191
102k
              res.push(o);
192
102k
              i = i1;
193
            }
194
          }
195
        }
196
8.24k
        Err(e) => return Err(e),
197
      }
198
    }
199
81.3k
  }
Unexecuted instantiation: nom::multi::many_till::<_, _, _, _, _, _>::{closure#0}
200
395k
}
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
5.00k
pub fn many_till<I, O, P, E, F, G>(
166
5.00k
  mut f: F,
167
5.00k
  mut g: G,
168
5.00k
) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E>
169
5.00k
where
170
5.00k
  I: Clone + InputLength,
171
5.00k
  F: Parser<I, O, E>,
172
5.00k
  G: Parser<I, P, E>,
173
5.00k
  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
5.00k
}
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
267k
pub fn many_till<I, O, P, E, F, G>(
166
267k
  mut f: F,
167
267k
  mut g: G,
168
267k
) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E>
169
267k
where
170
267k
  I: Clone + InputLength,
171
267k
  F: Parser<I, O, E>,
172
267k
  G: Parser<I, P, E>,
173
267k
  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
267k
}
Unexecuted instantiation: nom::multi::many_till::<_, _, _, _, _, _>
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
5.82k
pub fn many_till<I, O, P, E, F, G>(
166
5.82k
  mut f: F,
167
5.82k
  mut g: G,
168
5.82k
) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E>
169
5.82k
where
170
5.82k
  I: Clone + InputLength,
171
5.82k
  F: Parser<I, O, E>,
172
5.82k
  G: Parser<I, P, E>,
173
5.82k
  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
5.82k
}
nom::multi::many_till::<&[u8], suricata::pgsql::parser::PgsqlErrorNoticeMessageField, &[u8], nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_error_notice_fields::{closure#0}, nom::bytes::streaming::tag<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}>
Line
Count
Source
165
35.3k
pub fn many_till<I, O, P, E, F, G>(
166
35.3k
  mut f: F,
167
35.3k
  mut g: G,
168
35.3k
) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E>
169
35.3k
where
170
35.3k
  I: Clone + InputLength,
171
35.3k
  F: Parser<I, O, E>,
172
35.3k
  G: Parser<I, P, E>,
173
35.3k
  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
35.3k
}
nom::multi::many_till::<&[u8], der_parser::ber::ber::BerObject, der_parser::ber::ber::BerObject, der_parser::error::BerError, der_parser::ber::parser::r_parse_ber::{closure#0}, der_parser::ber::parser::parse_ber_endofcontent>
Line
Count
Source
165
81.3k
pub fn many_till<I, O, P, E, F, G>(
166
81.3k
  mut f: F,
167
81.3k
  mut g: G,
168
81.3k
) -> impl FnMut(I) -> IResult<I, (Vec<O>, P), E>
169
81.3k
where
170
81.3k
  I: Clone + InputLength,
171
81.3k
  F: Parser<I, O, E>,
172
81.3k
  G: Parser<I, P, E>,
173
81.3k
  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
81.3k
}
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
18.5k
pub fn separated_list1<I, O, O2, E, F, G>(
303
18.5k
  mut sep: G,
304
18.5k
  mut f: F,
305
18.5k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
306
18.5k
where
307
18.5k
  I: Clone + InputLength,
308
18.5k
  F: Parser<I, O, E>,
309
18.5k
  G: Parser<I, O2, E>,
310
18.5k
  E: ParseError<I>,
311
{
312
18.5k
  move |mut i: I| {
313
18.5k
    let mut res = Vec::new();
314
315
    // Parse the first element
316
18.5k
    match f.parse(i.clone()) {
317
233
      Err(e) => return Err(e),
318
18.3k
      Ok((i1, o)) => {
319
18.3k
        res.push(o);
320
18.3k
        i = i1;
321
18.3k
      }
322
    }
323
324
    loop {
325
95.7k
      let len = i.input_len();
326
95.7k
      match sep.parse(i.clone()) {
327
14.0k
        Err(Err::Error(_)) => return Ok((i, res)),
328
0
        Err(e) => return Err(e),
329
81.7k
        Ok((i1, _)) => {
330
          // infinite loop check: the parser must always consume
331
81.7k
          if i1.input_len() == len {
332
0
            return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList)));
333
81.7k
          }
334
335
81.7k
          match f.parse(i1.clone()) {
336
4.31k
            Err(Err::Error(_)) => return Ok((i, res)),
337
0
            Err(e) => return Err(e),
338
77.3k
            Ok((i2, o)) => {
339
77.3k
              res.push(o);
340
77.3k
              i = i2;
341
77.3k
            }
342
          }
343
        }
344
      }
345
    }
346
18.5k
  }
Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _>::{closure#0}
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
10.9k
  move |mut i: I| {
313
10.9k
    let mut res = Vec::new();
314
315
    // Parse the first element
316
10.9k
    match f.parse(i.clone()) {
317
70
      Err(e) => return Err(e),
318
10.8k
      Ok((i1, o)) => {
319
10.8k
        res.push(o);
320
10.8k
        i = i1;
321
10.8k
      }
322
    }
323
324
    loop {
325
78.8k
      let len = i.input_len();
326
78.8k
      match sep.parse(i.clone()) {
327
8.44k
        Err(Err::Error(_)) => return Ok((i, res)),
328
0
        Err(e) => return Err(e),
329
70.4k
        Ok((i1, _)) => {
330
          // infinite loop check: the parser must always consume
331
70.4k
          if i1.input_len() == len {
332
0
            return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList)));
333
70.4k
          }
334
335
70.4k
          match f.parse(i1.clone()) {
336
2.44k
            Err(Err::Error(_)) => return Ok((i, res)),
337
0
            Err(e) => return Err(e),
338
68.0k
            Ok((i2, o)) => {
339
68.0k
              res.push(o);
340
68.0k
              i = i2;
341
68.0k
            }
342
          }
343
        }
344
      }
345
    }
346
10.9k
  }
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.61k
  move |mut i: I| {
313
7.61k
    let mut res = Vec::new();
314
315
    // Parse the first element
316
7.61k
    match f.parse(i.clone()) {
317
163
      Err(e) => return Err(e),
318
7.45k
      Ok((i1, o)) => {
319
7.45k
        res.push(o);
320
7.45k
        i = i1;
321
7.45k
      }
322
    }
323
324
    loop {
325
16.8k
      let len = i.input_len();
326
16.8k
      match sep.parse(i.clone()) {
327
5.58k
        Err(Err::Error(_)) => return Ok((i, res)),
328
0
        Err(e) => return Err(e),
329
11.2k
        Ok((i1, _)) => {
330
          // infinite loop check: the parser must always consume
331
11.2k
          if i1.input_len() == len {
332
0
            return Err(Err::Error(E::from_error_kind(i1, ErrorKind::SeparatedList)));
333
11.2k
          }
334
335
11.2k
          match f.parse(i1.clone()) {
336
1.87k
            Err(Err::Error(_)) => return Ok((i, res)),
337
0
            Err(e) => return Err(e),
338
9.37k
            Ok((i2, o)) => {
339
9.37k
              res.push(o);
340
9.37k
              i = i2;
341
9.37k
            }
342
          }
343
        }
344
      }
345
    }
346
7.61k
  }
Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _>::{closure#0}
347
18.5k
}
Unexecuted instantiation: nom::multi::separated_list1::<_, _, _, _, _, _>
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
10.9k
pub fn separated_list1<I, O, O2, E, F, G>(
303
10.9k
  mut sep: G,
304
10.9k
  mut f: F,
305
10.9k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
306
10.9k
where
307
10.9k
  I: Clone + InputLength,
308
10.9k
  F: Parser<I, O, E>,
309
10.9k
  G: Parser<I, O2, E>,
310
10.9k
  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
10.9k
}
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.61k
pub fn separated_list1<I, O, O2, E, F, G>(
303
7.61k
  mut sep: G,
304
7.61k
  mut f: F,
305
7.61k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
306
7.61k
where
307
7.61k
  I: Clone + InputLength,
308
7.61k
  F: Parser<I, O, E>,
309
7.61k
  G: Parser<I, O2, E>,
310
7.61k
  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.61k
}
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
231k
pub fn many_m_n<I, O, E, F>(
381
231k
  min: usize,
382
231k
  max: usize,
383
231k
  mut parse: F,
384
231k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
385
231k
where
386
231k
  I: Clone + InputLength,
387
231k
  F: Parser<I, O, E>,
388
231k
  E: ParseError<I>,
389
{
390
159k
  move |mut input: I| {
391
159k
    if min > max {
392
0
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
159k
    }
394
395
159k
    let max_initial_capacity =
396
159k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
159k
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
2.30M
    for count in 0..max {
399
2.30M
      let len = input.input_len();
400
2.30M
      match parse.parse(input.clone()) {
401
2.26M
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
2.26M
          if tail.input_len() == len {
404
0
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
2.26M
          }
406
407
2.26M
          res.push(value);
408
2.26M
          input = tail;
409
        }
410
22.1k
        Err(Err::Error(e)) => {
411
22.1k
          if count < min {
412
13.9k
            return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e)));
413
          } else {
414
8.26k
            return Ok((input, res));
415
          }
416
        }
417
17.7k
        Err(e) => {
418
17.7k
          return Err(e);
419
        }
420
      }
421
    }
422
423
119k
    Ok((input, res))
424
159k
  }
Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _>::{closure#0}
nom::multi::many_m_n::<&[u8], suricata::dns::dns::DNSRData, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::dns::dns::DNSRData, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_answer::{closure#0}>::{closure#0}>::{closure#0}
Line
Count
Source
390
124k
  move |mut input: I| {
391
124k
    if min > max {
392
0
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
124k
    }
394
395
124k
    let max_initial_capacity =
396
124k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
124k
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
1.41M
    for count in 0..max {
399
1.41M
      let len = input.input_len();
400
1.41M
      match parse.parse(input.clone()) {
401
1.39M
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
1.39M
          if tail.input_len() == len {
404
0
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
1.39M
          }
406
407
1.39M
          res.push(value);
408
1.39M
          input = tail;
409
        }
410
18.1k
        Err(Err::Error(e)) => {
411
18.1k
          if count < min {
412
13.9k
            return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e)));
413
          } else {
414
4.28k
            return Ok((input, res));
415
          }
416
        }
417
0
        Err(e) => {
418
0
          return Err(e);
419
        }
420
      }
421
    }
422
423
106k
    Ok((input, res))
424
124k
  }
nom::multi::many_m_n::<&[u8], suricata::pgsql::parser::ColumnFieldValue, nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_data_row_value>::{closure#0}
Line
Count
Source
390
16.5k
  move |mut input: I| {
391
16.5k
    if min > max {
392
0
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
16.5k
    }
394
395
16.5k
    let max_initial_capacity =
396
16.5k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
16.5k
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
707k
    for count in 0..max {
399
707k
      let len = input.input_len();
400
707k
      match parse.parse(input.clone()) {
401
702k
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
702k
          if tail.input_len() == len {
404
0
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
702k
          }
406
407
702k
          res.push(value);
408
702k
          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
4.98k
        Err(e) => {
418
4.98k
          return Err(e);
419
        }
420
      }
421
    }
422
423
11.5k
    Ok((input, res))
424
16.5k
  }
nom::multi::many_m_n::<&[u8], suricata::pgsql::parser::RowField, nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_row_field>::{closure#0}
Line
Count
Source
390
18.1k
  move |mut input: I| {
391
18.1k
    if min > max {
392
0
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
18.1k
    }
394
395
18.1k
    let max_initial_capacity =
396
18.1k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
18.1k
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
180k
    for count in 0..max {
399
180k
      let len = input.input_len();
400
180k
      match parse.parse(input.clone()) {
401
164k
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
164k
          if tail.input_len() == len {
404
0
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
164k
          }
406
407
164k
          res.push(value);
408
164k
          input = tail;
409
        }
410
3.97k
        Err(Err::Error(e)) => {
411
3.97k
          if count < min {
412
0
            return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e)));
413
          } else {
414
3.97k
            return Ok((input, res));
415
          }
416
        }
417
12.7k
        Err(e) => {
418
12.7k
          return Err(e);
419
        }
420
      }
421
    }
422
423
1.34k
    Ok((input, res))
424
18.1k
  }
Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _>::{closure#0}
425
231k
}
Unexecuted instantiation: nom::multi::many_m_n::<_, _, _, _>
nom::multi::many_m_n::<&[u8], suricata::dns::dns::DNSRData, nom::error::Error<&[u8]>, nom::combinator::complete<&[u8], suricata::dns::dns::DNSRData, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_answer::{closure#0}>::{closure#0}>
Line
Count
Source
380
124k
pub fn many_m_n<I, O, E, F>(
381
124k
  min: usize,
382
124k
  max: usize,
383
124k
  mut parse: F,
384
124k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
385
124k
where
386
124k
  I: Clone + InputLength,
387
124k
  F: Parser<I, O, E>,
388
124k
  E: ParseError<I>,
389
{
390
  move |mut input: I| {
391
    if min > max {
392
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
    }
394
395
    let max_initial_capacity =
396
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
    for count in 0..max {
399
      let len = input.input_len();
400
      match parse.parse(input.clone()) {
401
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
          if tail.input_len() == len {
404
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
          }
406
407
          res.push(value);
408
          input = tail;
409
        }
410
        Err(Err::Error(e)) => {
411
          if count < min {
412
            return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e)));
413
          } else {
414
            return Ok((input, res));
415
          }
416
        }
417
        Err(e) => {
418
          return Err(e);
419
        }
420
      }
421
    }
422
423
    Ok((input, res))
424
  }
425
124k
}
nom::multi::many_m_n::<&[u8], suricata::pgsql::parser::ColumnFieldValue, nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_data_row_value>
Line
Count
Source
380
39.7k
pub fn many_m_n<I, O, E, F>(
381
39.7k
  min: usize,
382
39.7k
  max: usize,
383
39.7k
  mut parse: F,
384
39.7k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
385
39.7k
where
386
39.7k
  I: Clone + InputLength,
387
39.7k
  F: Parser<I, O, E>,
388
39.7k
  E: ParseError<I>,
389
{
390
  move |mut input: I| {
391
    if min > max {
392
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
    }
394
395
    let max_initial_capacity =
396
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
    for count in 0..max {
399
      let len = input.input_len();
400
      match parse.parse(input.clone()) {
401
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
          if tail.input_len() == len {
404
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
          }
406
407
          res.push(value);
408
          input = tail;
409
        }
410
        Err(Err::Error(e)) => {
411
          if count < min {
412
            return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e)));
413
          } else {
414
            return Ok((input, res));
415
          }
416
        }
417
        Err(e) => {
418
          return Err(e);
419
        }
420
      }
421
    }
422
423
    Ok((input, res))
424
  }
425
39.7k
}
nom::multi::many_m_n::<&[u8], suricata::pgsql::parser::RowField, nom::error::Error<&[u8]>, suricata::pgsql::parser::parse_row_field>
Line
Count
Source
380
67.1k
pub fn many_m_n<I, O, E, F>(
381
67.1k
  min: usize,
382
67.1k
  max: usize,
383
67.1k
  mut parse: F,
384
67.1k
) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
385
67.1k
where
386
67.1k
  I: Clone + InputLength,
387
67.1k
  F: Parser<I, O, E>,
388
67.1k
  E: ParseError<I>,
389
{
390
  move |mut input: I| {
391
    if min > max {
392
      return Err(Err::Failure(E::from_error_kind(input, ErrorKind::ManyMN)));
393
    }
394
395
    let max_initial_capacity =
396
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
397
    let mut res = crate::lib::std::vec::Vec::with_capacity(min.min(max_initial_capacity));
398
    for count in 0..max {
399
      let len = input.input_len();
400
      match parse.parse(input.clone()) {
401
        Ok((tail, value)) => {
402
          // infinite loop check: the parser must always consume
403
          if tail.input_len() == len {
404
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::ManyMN)));
405
          }
406
407
          res.push(value);
408
          input = tail;
409
        }
410
        Err(Err::Error(e)) => {
411
          if count < min {
412
            return Err(Err::Error(E::append(input, ErrorKind::ManyMN, e)));
413
          } else {
414
            return Ok((input, res));
415
          }
416
        }
417
        Err(e) => {
418
          return Err(e);
419
        }
420
      }
421
    }
422
423
    Ok((input, res))
424
  }
425
67.1k
}
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
0
pub fn many1_count<I, O, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, usize, E>
511
0
where
512
0
  I: Clone + InputLength,
513
0
  F: Parser<I, O, E>,
514
0
  E: ParseError<I>,
515
{
516
0
  move |i: I| {
517
0
    let i_ = i.clone();
518
0
    match f.parse(i_) {
519
0
      Err(Err::Error(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count))),
520
0
      Err(i) => Err(i),
521
0
      Ok((i1, _)) => {
522
0
        let mut count = 1;
523
0
        let mut input = i1;
524
525
        loop {
526
0
          let len = input.input_len();
527
0
          let input_ = input.clone();
528
0
          match f.parse(input_) {
529
0
            Err(Err::Error(_)) => return Ok((input, count)),
530
0
            Err(e) => return Err(e),
531
0
            Ok((i, _)) => {
532
              // infinite loop check: the parser must always consume
533
0
              if i.input_len() == len {
534
0
                return Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1Count)));
535
0
              }
536
537
0
              count += 1;
538
0
              input = i;
539
            }
540
          }
541
        }
542
      }
543
    }
544
0
  }
Unexecuted instantiation: nom::multi::many1_count::<_, _, _, _>::{closure#0}
Unexecuted instantiation: nom::multi::many1_count::<_, _, _, _>::{closure#0}
545
0
}
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
3.50M
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
3.50M
where
571
3.50M
  I: Clone + PartialEq,
572
3.50M
  F: Parser<I, O, E>,
573
3.50M
  E: ParseError<I>,
574
{
575
3.49M
  move |i: I| {
576
3.49M
    let mut input = i.clone();
577
3.49M
    let max_initial_capacity =
578
3.49M
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
3.49M
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
3.49M
    for _ in 0..count {
582
4.06M
      let input_ = input.clone();
583
4.06M
      match f.parse(input_) {
584
3.79M
        Ok((i, o)) => {
585
3.79M
          res.push(o);
586
3.79M
          input = i;
587
3.79M
        }
588
63.2k
        Err(Err::Error(e)) => {
589
63.2k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
203k
        Err(e) => {
592
203k
          return Err(e);
593
        }
594
      }
595
    }
596
597
3.23M
    Ok((input, res))
598
3.49M
  }
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
1.78k
  move |i: I| {
576
1.78k
    let mut input = i.clone();
577
1.78k
    let max_initial_capacity =
578
1.78k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
1.78k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
1.78k
    for _ in 0..count {
582
5.91k
      let input_ = input.clone();
583
5.91k
      match f.parse(input_) {
584
5.16k
        Ok((i, o)) => {
585
5.16k
          res.push(o);
586
5.16k
          input = i;
587
5.16k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
754
        Err(e) => {
592
754
          return Err(e);
593
        }
594
      }
595
    }
596
597
1.03k
    Ok((input, res))
598
1.78k
  }
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
64.0k
  move |i: I| {
576
64.0k
    let mut input = i.clone();
577
64.0k
    let max_initial_capacity =
578
64.0k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
64.0k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
64.0k
    for _ in 0..count {
582
96.6k
      let input_ = input.clone();
583
96.6k
      match f.parse(input_) {
584
50.6k
        Ok((i, o)) => {
585
50.6k
          res.push(o);
586
50.6k
          input = i;
587
50.6k
        }
588
7.72k
        Err(Err::Error(e)) => {
589
7.72k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
38.2k
        Err(e) => {
592
38.2k
          return Err(e);
593
        }
594
      }
595
    }
596
597
18.0k
    Ok((input, res))
598
64.0k
  }
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
58.7k
  move |i: I| {
576
58.7k
    let mut input = i.clone();
577
58.7k
    let max_initial_capacity =
578
58.7k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
58.7k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
58.7k
    for _ in 0..count {
582
111k
      let input_ = input.clone();
583
111k
      match f.parse(input_) {
584
60.6k
        Ok((i, o)) => {
585
60.6k
          res.push(o);
586
60.6k
          input = i;
587
60.6k
        }
588
11.8k
        Err(Err::Error(e)) => {
589
11.8k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
38.6k
        Err(e) => {
592
38.6k
          return Err(e);
593
        }
594
      }
595
    }
596
597
8.31k
    Ok((input, res))
598
58.7k
  }
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
224k
  move |i: I| {
576
224k
    let mut input = i.clone();
577
224k
    let max_initial_capacity =
578
224k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
224k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
224k
    for _ in 0..count {
582
66.0k
      let input_ = input.clone();
583
66.0k
      match f.parse(input_) {
584
60.6k
        Ok((i, o)) => {
585
60.6k
          res.push(o);
586
60.6k
          input = i;
587
60.6k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
5.35k
        Err(e) => {
592
5.35k
          return Err(e);
593
        }
594
      }
595
    }
596
597
219k
    Ok((input, res))
598
224k
  }
Unexecuted instantiation: nom::multi::count::<_, _, _, _>::{closure#0}
nom::multi::count::<&[u8], suricata::dns::dns::DNSQueryEntry, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_request_body::{closure#0}>::{closure#0}
Line
Count
Source
575
1.31M
  move |i: I| {
576
1.31M
    let mut input = i.clone();
577
1.31M
    let max_initial_capacity =
578
1.31M
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
1.31M
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
1.31M
    for _ in 0..count {
582
1.22M
      let input_ = input.clone();
583
1.22M
      match f.parse(input_) {
584
1.20M
        Ok((i, o)) => {
585
1.20M
          res.push(o);
586
1.20M
          input = i;
587
1.20M
        }
588
8.87k
        Err(Err::Error(e)) => {
589
8.87k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
14.8k
        Err(e) => {
592
14.8k
          return Err(e);
593
        }
594
      }
595
    }
596
597
1.29M
    Ok((input, res))
598
1.31M
  }
nom::multi::count::<&[u8], suricata::dns::dns::DNSQueryEntry, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_response_body::{closure#0}>::{closure#0}
Line
Count
Source
575
1.49M
  move |i: I| {
576
1.49M
    let mut input = i.clone();
577
1.49M
    let max_initial_capacity =
578
1.49M
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
1.49M
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
1.49M
    for _ in 0..count {
582
974k
      let input_ = input.clone();
583
974k
      match f.parse(input_) {
584
963k
        Ok((i, o)) => {
585
963k
          res.push(o);
586
963k
          input = i;
587
963k
        }
588
7.08k
        Err(Err::Error(e)) => {
589
7.08k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
3.83k
        Err(e) => {
592
3.83k
          return Err(e);
593
        }
594
      }
595
    }
596
597
1.48M
    Ok((input, res))
598
1.49M
  }
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
2.75k
  move |i: I| {
576
2.75k
    let mut input = i.clone();
577
2.75k
    let max_initial_capacity =
578
2.75k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
2.75k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
2.75k
    for _ in 0..count {
582
2.19k
      let input_ = input.clone();
583
2.19k
      match f.parse(input_) {
584
1.75k
        Ok((i, o)) => {
585
1.75k
          res.push(o);
586
1.75k
          input = i;
587
1.75k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
439
        Err(e) => {
592
439
          return Err(e);
593
        }
594
      }
595
    }
596
597
2.31k
    Ok((input, res))
598
2.75k
  }
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
72.8k
  move |i: I| {
576
72.8k
    let mut input = i.clone();
577
72.8k
    let max_initial_capacity =
578
72.8k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
72.8k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
72.8k
    for _ in 0..count {
582
121k
      let input_ = input.clone();
583
121k
      match f.parse(input_) {
584
67.6k
        Ok((i, o)) => {
585
67.6k
          res.push(o);
586
67.6k
          input = i;
587
67.6k
        }
588
11.3k
        Err(Err::Error(e)) => {
589
11.3k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
42.3k
        Err(e) => {
592
42.3k
          return Err(e);
593
        }
594
      }
595
    }
596
597
19.0k
    Ok((input, res))
598
72.8k
  }
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
56.6k
  move |i: I| {
576
56.6k
    let mut input = i.clone();
577
56.6k
    let max_initial_capacity =
578
56.6k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
56.6k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
56.6k
    for _ in 0..count {
582
103k
      let input_ = input.clone();
583
103k
      match f.parse(input_) {
584
57.4k
        Ok((i, o)) => {
585
57.4k
          res.push(o);
586
57.4k
          input = i;
587
57.4k
        }
588
11.8k
        Err(Err::Error(e)) => {
589
11.8k
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
34.3k
        Err(e) => {
592
34.3k
          return Err(e);
593
        }
594
      }
595
    }
596
597
10.4k
    Ok((input, res))
598
56.6k
  }
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
72.3k
  move |i: I| {
576
72.3k
    let mut input = i.clone();
577
72.3k
    let max_initial_capacity =
578
72.3k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
72.3k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
72.3k
    for _ in 0..count {
582
66.7k
      let input_ = input.clone();
583
66.7k
      match f.parse(input_) {
584
66.5k
        Ok((i, o)) => {
585
66.5k
          res.push(o);
586
66.5k
          input = i;
587
66.5k
        }
588
80
        Err(Err::Error(e)) => {
589
80
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
96
        Err(e) => {
592
96
          return Err(e);
593
        }
594
      }
595
    }
596
597
72.1k
    Ok((input, res))
598
72.3k
  }
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
7.05k
  move |i: I| {
576
7.05k
    let mut input = i.clone();
577
7.05k
    let max_initial_capacity =
578
7.05k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
7.05k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
7.05k
    for _ in 0..count {
582
73.5k
      let input_ = input.clone();
583
73.5k
      match f.parse(input_) {
584
68.0k
        Ok((i, o)) => {
585
68.0k
          res.push(o);
586
68.0k
          input = i;
587
68.0k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
5.46k
        Err(e) => {
592
5.46k
          return Err(e);
593
        }
594
      }
595
    }
596
597
1.58k
    Ok((input, res))
598
7.05k
  }
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
8.23k
  move |i: I| {
576
8.23k
    let mut input = i.clone();
577
8.23k
    let max_initial_capacity =
578
8.23k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
8.23k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
8.23k
    for _ in 0..count {
582
56.6k
      let input_ = input.clone();
583
56.6k
      match f.parse(input_) {
584
49.8k
        Ok((i, o)) => {
585
49.8k
          res.push(o);
586
49.8k
          input = i;
587
49.8k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
6.81k
        Err(e) => {
592
6.81k
          return Err(e);
593
        }
594
      }
595
    }
596
597
1.42k
    Ok((input, res))
598
8.23k
  }
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
3.32k
  move |i: I| {
576
3.32k
    let mut input = i.clone();
577
3.32k
    let max_initial_capacity =
578
3.32k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
3.32k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
3.32k
    for _ in 0..count {
582
17.3k
      let input_ = input.clone();
583
17.3k
      match f.parse(input_) {
584
15.9k
        Ok((i, o)) => {
585
15.9k
          res.push(o);
586
15.9k
          input = i;
587
15.9k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
1.36k
        Err(e) => {
592
1.36k
          return Err(e);
593
        }
594
      }
595
    }
596
597
1.96k
    Ok((input, res))
598
3.32k
  }
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
16.4k
  move |i: I| {
576
16.4k
    let mut input = i.clone();
577
16.4k
    let max_initial_capacity =
578
16.4k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
16.4k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
16.4k
    for _ in 0..count {
582
999k
      let input_ = input.clone();
583
999k
      match f.parse(input_) {
584
996k
        Ok((i, o)) => {
585
996k
          res.push(o);
586
996k
          input = i;
587
996k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
3.28k
        Err(e) => {
592
3.28k
          return Err(e);
593
        }
594
      }
595
    }
596
597
13.1k
    Ok((input, res))
598
16.4k
  }
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
18.4k
  move |i: I| {
576
18.4k
    let mut input = i.clone();
577
18.4k
    let max_initial_capacity =
578
18.4k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
18.4k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
18.4k
    for _ in 0..count {
582
76.0k
      let input_ = input.clone();
583
76.0k
      match f.parse(input_) {
584
71.5k
        Ok((i, o)) => {
585
71.5k
          res.push(o);
586
71.5k
          input = i;
587
71.5k
        }
588
4.43k
        Err(Err::Error(e)) => {
589
4.43k
          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
14.0k
    Ok((input, res))
598
18.4k
  }
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
69.4k
  move |i: I| {
576
69.4k
    let mut input = i.clone();
577
69.4k
    let max_initial_capacity =
578
69.4k
      MAX_INITIAL_CAPACITY_BYTES / crate::lib::std::mem::size_of::<O>().max(1);
579
69.4k
    let mut res = crate::lib::std::vec::Vec::with_capacity(count.min(max_initial_capacity));
580
581
69.4k
    for _ in 0..count {
582
67.0k
      let input_ = input.clone();
583
67.0k
      match f.parse(input_) {
584
59.8k
        Ok((i, o)) => {
585
59.8k
          res.push(o);
586
59.8k
          input = i;
587
59.8k
        }
588
0
        Err(Err::Error(e)) => {
589
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
590
        }
591
7.17k
        Err(e) => {
592
7.17k
          return Err(e);
593
        }
594
      }
595
    }
596
597
62.3k
    Ok((input, res))
598
69.4k
  }
Unexecuted instantiation: nom::multi::count::<_, _, _, _>::{closure#0}
599
3.50M
}
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4Handle, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_parse_handle>
Line
Count
Source
569
1.78k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
1.78k
where
571
1.78k
  I: Clone + PartialEq,
572
1.78k
  F: Parser<I, O, E>,
573
1.78k
  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.78k
}
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
64.0k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
64.0k
where
571
64.0k
  I: Clone + PartialEq,
572
64.0k
  F: Parser<I, O, E>,
573
64.0k
  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
64.0k
}
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
58.7k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
58.7k
where
571
58.7k
  I: Clone + PartialEq,
572
58.7k
  F: Parser<I, O, E>,
573
58.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
58.7k
}
nom::multi::count::<&[u8], ipsec_parser::ikev2_transforms::IkeV2RawTransform, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_transform>
Line
Count
Source
569
228k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
228k
where
571
228k
  I: Clone + PartialEq,
572
228k
  F: Parser<I, O, E>,
573
228k
  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
228k
}
Unexecuted instantiation: nom::multi::count::<_, _, _, _>
nom::multi::count::<&[u8], suricata::dns::dns::DNSQueryEntry, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_request_body::{closure#0}>
Line
Count
Source
569
1.31M
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
1.31M
where
571
1.31M
  I: Clone + PartialEq,
572
1.31M
  F: Parser<I, O, E>,
573
1.31M
  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.31M
}
nom::multi::count::<&[u8], suricata::dns::dns::DNSQueryEntry, nom::error::Error<&[u8]>, suricata::dns::parser::dns_parse_response_body::{closure#0}>
Line
Count
Source
569
1.49M
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
1.49M
where
571
1.49M
  I: Clone + PartialEq,
572
1.49M
  F: Parser<I, O, E>,
573
1.49M
  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.49M
}
nom::multi::count::<&[u8], suricata::nfs::nfs4_records::Nfs4Handle, nom::error::Error<&[u8]>, suricata::nfs::nfs4_records::nfs4_parse_handle>
Line
Count
Source
569
2.75k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
2.75k
where
571
2.75k
  I: Clone + PartialEq,
572
2.75k
  F: Parser<I, O, E>,
573
2.75k
  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.75k
}
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
72.8k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
72.8k
where
571
72.8k
  I: Clone + PartialEq,
572
72.8k
  F: Parser<I, O, E>,
573
72.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
72.8k
}
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
56.6k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
56.6k
where
571
56.6k
  I: Clone + PartialEq,
572
56.6k
  F: Parser<I, O, E>,
573
56.6k
  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
56.6k
}
nom::multi::count::<&[u8], suricata::dcerpc::dcerpc::DCERPCBindAckResult, nom::error::Error<&[u8]>, suricata::dcerpc::parser::parse_dcerpc_bindack_result>
Line
Count
Source
569
72.3k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
72.3k
where
571
72.3k
  I: Clone + PartialEq,
572
72.3k
  F: Parser<I, O, E>,
573
72.3k
  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
72.3k
}
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
7.05k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
7.05k
where
571
7.05k
  I: Clone + PartialEq,
572
7.05k
  F: Parser<I, O, E>,
573
7.05k
  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
7.05k
}
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
8.23k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
8.23k
where
571
8.23k
  I: Clone + PartialEq,
572
8.23k
  F: Parser<I, O, E>,
573
8.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
8.23k
}
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
3.32k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
3.32k
where
571
3.32k
  I: Clone + PartialEq,
572
3.32k
  F: Parser<I, O, E>,
573
3.32k
  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.32k
}
nom::multi::count::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::le_u16<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
569
16.4k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
16.4k
where
571
16.4k
  I: Clone + PartialEq,
572
16.4k
  F: Parser<I, O, E>,
573
16.4k
  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
16.4k
}
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
18.4k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
18.4k
where
571
18.4k
  I: Clone + PartialEq,
572
18.4k
  F: Parser<I, O, E>,
573
18.4k
  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
18.4k
}
nom::multi::count::<&[u8], ipsec_parser::ikev2_transforms::IkeV2RawTransform, nom::error::Error<&[u8]>, ipsec_parser::ikev2_parser::parse_ikev2_transform>
Line
Count
Source
569
75.5k
pub fn count<I, O, E, F>(mut f: F, count: usize) -> impl FnMut(I) -> IResult<I, Vec<O>, E>
570
75.5k
where
571
75.5k
  I: Clone + PartialEq,
572
75.5k
  F: Parser<I, O, E>,
573
75.5k
  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
75.5k
}
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
0
pub fn fold_many0<I, O, E, F, G, H, R>(
690
0
  mut f: F,
691
0
  mut init: H,
692
0
  mut g: G,
693
0
) -> impl FnMut(I) -> IResult<I, R, E>
694
0
where
695
0
  I: Clone + InputLength,
696
0
  F: Parser<I, O, E>,
697
0
  G: FnMut(R, O) -> R,
698
0
  H: FnMut() -> R,
699
0
  E: ParseError<I>,
700
{
701
0
  move |i: I| {
702
0
    let mut res = init();
703
0
    let mut input = i;
704
705
    loop {
706
0
      let i_ = input.clone();
707
0
      let len = input.input_len();
708
0
      match f.parse(i_) {
709
0
        Ok((i, o)) => {
710
          // infinite loop check: the parser must always consume
711
0
          if i.input_len() == len {
712
0
            return Err(Err::Error(E::from_error_kind(input, ErrorKind::Many0)));
713
0
          }
714
715
0
          res = g(res, o);
716
0
          input = i;
717
        }
718
        Err(Err::Error(_)) => {
719
0
          return Ok((input, res));
720
        }
721
0
        Err(e) => {
722
0
          return Err(e);
723
        }
724
      }
725
    }
726
0
  }
Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _>::{closure#0}
Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _>::{closure#0}
727
0
}
Unexecuted instantiation: nom::multi::fold_many0::<_, _, _, _, _, _, _>
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
13.9M
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
13.9M
where
923
13.9M
  I: InputLength + InputTake,
924
13.9M
  N: ToUsize,
925
13.9M
  F: Parser<I, N, E>,
926
13.9M
  E: ParseError<I>,
927
{
928
14.7M
  move |i: I| {
929
14.7M
    let (i, length) = f.parse(i)?;
930
931
14.0M
    let length: usize = length.to_usize();
932
933
14.0M
    if let Some(needed) = length
934
14.0M
      .checked_sub(i.input_len())
935
14.0M
      .and_then(NonZeroUsize::new)
936
    {
937
318k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
13.7M
      Ok(i.take_split(length))
940
    }
941
14.7M
  }
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
98.2k
  move |i: I| {
929
98.2k
    let (i, length) = f.parse(i)?;
930
931
95.4k
    let length: usize = length.to_usize();
932
933
95.4k
    if let Some(needed) = length
934
95.4k
      .checked_sub(i.input_len())
935
95.4k
      .and_then(NonZeroUsize::new)
936
    {
937
9.16k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
86.3k
      Ok(i.take_split(length))
940
    }
941
98.2k
  }
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
7.24k
  move |i: I| {
929
7.24k
    let (i, length) = f.parse(i)?;
930
931
6.21k
    let length: usize = length.to_usize();
932
933
6.21k
    if let Some(needed) = length
934
6.21k
      .checked_sub(i.input_len())
935
6.21k
      .and_then(NonZeroUsize::new)
936
    {
937
10
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
6.20k
      Ok(i.take_split(length))
940
    }
941
7.24k
  }
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
505k
  move |i: I| {
929
505k
    let (i, length) = f.parse(i)?;
930
931
502k
    let length: usize = length.to_usize();
932
933
502k
    if let Some(needed) = length
934
502k
      .checked_sub(i.input_len())
935
502k
      .and_then(NonZeroUsize::new)
936
    {
937
8.21k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
493k
      Ok(i.take_split(length))
940
    }
941
505k
  }
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
575k
  move |i: I| {
929
575k
    let (i, length) = f.parse(i)?;
930
931
346k
    let length: usize = length.to_usize();
932
933
346k
    if let Some(needed) = length
934
346k
      .checked_sub(i.input_len())
935
346k
      .and_then(NonZeroUsize::new)
936
    {
937
2.54k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
343k
      Ok(i.take_split(length))
940
    }
941
575k
  }
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
1.64M
  move |i: I| {
929
1.64M
    let (i, length) = f.parse(i)?;
930
931
1.62M
    let length: usize = length.to_usize();
932
933
1.62M
    if let Some(needed) = length
934
1.62M
      .checked_sub(i.input_len())
935
1.62M
      .and_then(NonZeroUsize::new)
936
    {
937
15.6k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
1.61M
      Ok(i.take_split(length))
940
    }
941
1.64M
  }
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _>::{closure#0}
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
1.85M
  move |i: I| {
929
1.85M
    let (i, length) = f.parse(i)?;
930
931
1.50M
    let length: usize = length.to_usize();
932
933
1.50M
    if let Some(needed) = length
934
1.50M
      .checked_sub(i.input_len())
935
1.50M
      .and_then(NonZeroUsize::new)
936
    {
937
70.2k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
1.43M
      Ok(i.take_split(length))
940
    }
941
1.85M
  }
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
6.30M
  move |i: I| {
929
6.30M
    let (i, length) = f.parse(i)?;
930
931
6.30M
    let length: usize = length.to_usize();
932
933
6.30M
    if let Some(needed) = length
934
6.30M
      .checked_sub(i.input_len())
935
6.30M
      .and_then(NonZeroUsize::new)
936
    {
937
8.10k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
6.29M
      Ok(i.take_split(length))
940
    }
941
6.30M
  }
nom::multi::length_data::<&[u8], u32, suricata::rdp::error::RdpError, suricata::rdp::util::parse_per_length_determinant>::{closure#0}
Line
Count
Source
928
26.0k
  move |i: I| {
929
26.0k
    let (i, length) = f.parse(i)?;
930
931
25.3k
    let length: usize = length.to_usize();
932
933
25.3k
    if let Some(needed) = length
934
25.3k
      .checked_sub(i.input_len())
935
25.3k
      .and_then(NonZeroUsize::new)
936
    {
937
877
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
24.4k
      Ok(i.take_split(length))
940
    }
941
26.0k
  }
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
270k
  move |i: I| {
929
270k
    let (i, length) = f.parse(i)?;
930
931
266k
    let length: usize = length.to_usize();
932
933
266k
    if let Some(needed) = length
934
266k
      .checked_sub(i.input_len())
935
266k
      .and_then(NonZeroUsize::new)
936
    {
937
28.9k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
237k
      Ok(i.take_split(length))
940
    }
941
270k
  }
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.84k
  move |i: I| {
929
6.84k
    let (i, length) = f.parse(i)?;
930
931
5.89k
    let length: usize = length.to_usize();
932
933
5.89k
    if let Some(needed) = length
934
5.89k
      .checked_sub(i.input_len())
935
5.89k
      .and_then(NonZeroUsize::new)
936
    {
937
28
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
5.86k
      Ok(i.take_split(length))
940
    }
941
6.84k
  }
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
347k
  move |i: I| {
929
347k
    let (i, length) = f.parse(i)?;
930
931
343k
    let length: usize = length.to_usize();
932
933
343k
    if let Some(needed) = length
934
343k
      .checked_sub(i.input_len())
935
343k
      .and_then(NonZeroUsize::new)
936
    {
937
6.32k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
337k
      Ok(i.take_split(length))
940
    }
941
347k
  }
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
306k
  move |i: I| {
929
306k
    let (i, length) = f.parse(i)?;
930
931
281k
    let length: usize = length.to_usize();
932
933
281k
    if let Some(needed) = length
934
281k
      .checked_sub(i.input_len())
935
281k
      .and_then(NonZeroUsize::new)
936
    {
937
146k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
134k
      Ok(i.take_split(length))
940
    }
941
306k
  }
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
2.76M
  move |i: I| {
929
2.76M
    let (i, length) = f.parse(i)?;
930
931
2.75M
    let length: usize = length.to_usize();
932
933
2.75M
    if let Some(needed) = length
934
2.75M
      .checked_sub(i.input_len())
935
2.75M
      .and_then(NonZeroUsize::new)
936
    {
937
22.2k
      Err(Err::Incomplete(Needed::Size(needed)))
938
    } else {
939
2.72M
      Ok(i.take_split(length))
940
    }
941
2.76M
  }
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _>::{closure#0}
942
13.9M
}
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u32<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
98.2k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
98.2k
where
923
98.2k
  I: InputLength + InputTake,
924
98.2k
  N: ToUsize,
925
98.2k
  F: Parser<I, N, E>,
926
98.2k
  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
98.2k
}
nom::multi::length_data::<&[u8], u16, asn1_rs::error::Error, nom::number::streaming::be_u16<&[u8], asn1_rs::error::Error>>
Line
Count
Source
921
7.24k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
7.24k
where
923
7.24k
  I: InputLength + InputTake,
924
7.24k
  N: ToUsize,
925
7.24k
  F: Parser<I, N, E>,
926
7.24k
  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
7.24k
}
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
232k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
232k
where
923
232k
  I: InputLength + InputTake,
924
232k
  N: ToUsize,
925
232k
  F: Parser<I, N, E>,
926
232k
  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
232k
}
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
505k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
505k
where
923
505k
  I: InputLength + InputTake,
924
505k
  N: ToUsize,
925
505k
  F: Parser<I, N, E>,
926
505k
  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
505k
}
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
1.59M
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
1.59M
where
923
1.59M
  I: InputLength + InputTake,
924
1.59M
  N: ToUsize,
925
1.59M
  F: Parser<I, N, E>,
926
1.59M
  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
1.59M
}
Unexecuted instantiation: nom::multi::length_data::<_, _, _, _>
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
1.85M
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
1.85M
where
923
1.85M
  I: InputLength + InputTake,
924
1.85M
  N: ToUsize,
925
1.85M
  F: Parser<I, N, E>,
926
1.85M
  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
1.85M
}
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
6.30M
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
6.30M
where
923
6.30M
  I: InputLength + InputTake,
924
6.30M
  N: ToUsize,
925
6.30M
  F: Parser<I, N, E>,
926
6.30M
  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.30M
}
nom::multi::length_data::<&[u8], u32, suricata::rdp::error::RdpError, suricata::rdp::util::parse_per_length_determinant>
Line
Count
Source
921
26.0k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
26.0k
where
923
26.0k
  I: InputLength + InputTake,
924
26.0k
  N: ToUsize,
925
26.0k
  F: Parser<I, N, E>,
926
26.0k
  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
26.0k
}
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u32<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
270k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
270k
where
923
270k
  I: InputLength + InputTake,
924
270k
  N: ToUsize,
925
270k
  F: Parser<I, N, E>,
926
270k
  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
270k
}
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.84k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
6.84k
where
923
6.84k
  I: InputLength + InputTake,
924
6.84k
  N: ToUsize,
925
6.84k
  F: Parser<I, N, E>,
926
6.84k
  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.84k
}
nom::multi::length_data::<&[u8], u32, nom::error::Error<&[u8]>, nom::number::streaming::be_u24<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
172k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
172k
where
923
172k
  I: InputLength + InputTake,
924
172k
  N: ToUsize,
925
172k
  F: Parser<I, N, E>,
926
172k
  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
172k
}
nom::multi::length_data::<&[u8], u8, nom::error::Error<&[u8]>, nom::number::streaming::be_u8<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
347k
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
347k
where
923
347k
  I: InputLength + InputTake,
924
347k
  N: ToUsize,
925
347k
  F: Parser<I, N, E>,
926
347k
  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
347k
}
nom::multi::length_data::<&[u8], u16, nom::error::Error<&[u8]>, nom::number::streaming::be_u16<&[u8], nom::error::Error<&[u8]>>>
Line
Count
Source
921
2.53M
pub fn length_data<I, N, E, F>(mut f: F) -> impl FnMut(I) -> IResult<I, I, E>
922
2.53M
where
923
2.53M
  I: InputLength + InputTake,
924
2.53M
  N: ToUsize,
925
2.53M
  F: Parser<I, N, E>,
926
2.53M
  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.53M
}
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
209k
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
209k
where
1020
209k
  I: Clone,
1021
209k
  N: ToUsize,
1022
209k
  F: Parser<I, N, E>,
1023
209k
  G: Parser<I, O, E>,
1024
209k
  E: ParseError<I>,
1025
{
1026
209k
  move |i: I| {
1027
209k
    let (i, count) = f.parse(i)?;
1028
207k
    let mut input = i.clone();
1029
207k
    let mut res = Vec::new();
1030
1031
207k
    for _ in 0..count.to_usize() {
1032
392k
      let input_ = input.clone();
1033
392k
      match g.parse(input_) {
1034
387k
        Ok((i, o)) => {
1035
387k
          res.push(o);
1036
387k
          input = i;
1037
387k
        }
1038
0
        Err(Err::Error(e)) => {
1039
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
1040
        }
1041
5.09k
        Err(e) => {
1042
5.09k
          return Err(e);
1043
        }
1044
      }
1045
    }
1046
1047
202k
    Ok((input, res))
1048
209k
  }
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
193k
  move |i: I| {
1027
193k
    let (i, count) = f.parse(i)?;
1028
192k
    let mut input = i.clone();
1029
192k
    let mut res = Vec::new();
1030
1031
192k
    for _ in 0..count.to_usize() {
1032
351k
      let input_ = input.clone();
1033
351k
      match g.parse(input_) {
1034
349k
        Ok((i, o)) => {
1035
349k
          res.push(o);
1036
349k
          input = i;
1037
349k
        }
1038
0
        Err(Err::Error(e)) => {
1039
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
1040
        }
1041
2.27k
        Err(e) => {
1042
2.27k
          return Err(e);
1043
        }
1044
      }
1045
    }
1046
1047
190k
    Ok((input, res))
1048
193k
  }
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
16.5k
  move |i: I| {
1027
16.5k
    let (i, count) = f.parse(i)?;
1028
15.3k
    let mut input = i.clone();
1029
15.3k
    let mut res = Vec::new();
1030
1031
15.3k
    for _ in 0..count.to_usize() {
1032
40.4k
      let input_ = input.clone();
1033
40.4k
      match g.parse(input_) {
1034
37.5k
        Ok((i, o)) => {
1035
37.5k
          res.push(o);
1036
37.5k
          input = i;
1037
37.5k
        }
1038
0
        Err(Err::Error(e)) => {
1039
0
          return Err(Err::Error(E::append(i, ErrorKind::Count, e)));
1040
        }
1041
2.82k
        Err(e) => {
1042
2.82k
          return Err(e);
1043
        }
1044
      }
1045
    }
1046
1047
12.4k
    Ok((input, res))
1048
16.5k
  }
Unexecuted instantiation: nom::multi::length_count::<_, _, _, _, _, _>::{closure#0}
1049
209k
}
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
193k
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
193k
where
1020
193k
  I: Clone,
1021
193k
  N: ToUsize,
1022
193k
  F: Parser<I, N, E>,
1023
193k
  G: Parser<I, O, E>,
1024
193k
  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
193k
}
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
16.5k
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
16.5k
where
1020
16.5k
  I: Clone,
1021
16.5k
  N: ToUsize,
1022
16.5k
  F: Parser<I, N, E>,
1023
16.5k
  G: Parser<I, O, E>,
1024
16.5k
  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
16.5k
}
Unexecuted instantiation: nom::multi::length_count::<_, _, _, _, _, _>