Coverage Report

Created: 2026-11-12 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/nom-8.0.0/src/bytes/mod.rs
Line
Count
Source
1
//! Parsers recognizing bytes streams
2
3
pub mod complete;
4
pub mod streaming;
5
#[cfg(test)]
6
mod tests;
7
8
use core::marker::PhantomData;
9
10
use crate::error::ErrorKind;
11
use crate::error::ParseError;
12
use crate::internal::{Err, Needed, Parser};
13
use crate::lib::std::result::Result::*;
14
use crate::traits::{Compare, CompareResult};
15
use crate::AsChar;
16
use crate::Check;
17
use crate::ExtendInto;
18
use crate::FindSubstring;
19
use crate::FindToken;
20
use crate::Input;
21
use crate::IsStreaming;
22
use crate::Mode;
23
use crate::OutputM;
24
use crate::OutputMode;
25
use crate::ToUsize;
26
27
/// Recognizes a pattern.
28
///
29
/// The input data will be compared to the tag combinator's argument and will return the part of
30
/// the input that matches the argument.
31
/// # Example
32
/// ```rust
33
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
34
/// use nom::bytes::streaming::tag;
35
///
36
/// fn parser(s: &str) -> IResult<&str, &str> {
37
///   tag("Hello")(s)
38
/// }
39
///
40
/// assert_eq!(parser("Hello, World!"), Ok((", World!", "Hello")));
41
/// assert_eq!(parser("Something"), Err(Err::Error(Error::new("Something", ErrorKind::Tag))));
42
/// assert_eq!(parser("S"), Err(Err::Error(Error::new("S", ErrorKind::Tag))));
43
/// assert_eq!(parser("H"), Err(Err::Incomplete(Needed::new(4))));
44
/// ```
45
0
pub fn tag<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
46
0
where
47
0
  I: Input + Compare<T>,
48
0
  T: Input + Clone,
49
{
50
0
  Tag {
51
0
    tag,
52
0
    e: PhantomData,
53
0
  }
54
0
}
55
56
/// Tag implementation
57
pub struct Tag<T, E> {
58
  tag: T,
59
  e: PhantomData<E>,
60
}
61
62
impl<I, Error: ParseError<I>, T> Parser<I> for Tag<T, Error>
63
where
64
  I: Input + Compare<T>,
65
  T: Input + Clone,
66
{
67
  type Output = I;
68
69
  type Error = Error;
70
71
132M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
132M
    let tag_len = self.tag.input_len();
73
132M
    let t = self.tag.clone();
74
75
132M
    match i.compare(t) {
76
31.3M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
76
12.6k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
3.56M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
76
1.81k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
1.85M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
844
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
30.0k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
17
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
76
196k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
76
497k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
33.3k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
1.80k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, suricata::detect::error::RuleParseError<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
76
439k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
17
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
27.1k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
76
18.2M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
76
6.46M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
Unexecuted instantiation: <nom::bytes::Tag<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
77
      CompareResult::Incomplete => {
78
1.51M
        if OM::Incomplete::is_streaming() {
79
60.1k
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
1.45M
          Err(Err::Error(OM::Error::bind(|| {
82
1.45M
            let e: ErrorKind = ErrorKind::Tag;
83
1.45M
            Error::from_error_kind(i, e)
84
1.45M
          })))
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
81
56
          Err(Err::Error(OM::Error::bind(|| {
82
56
            let e: ErrorKind = ErrorKind::Tag;
83
56
            Error::from_error_kind(i, e)
84
56
          })))
Unexecuted instantiation: <nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
<nom::bytes::Tag<&[u8], nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
81
8
          Err(Err::Error(OM::Error::bind(|| {
82
8
            let e: ErrorKind = ErrorKind::Tag;
83
8
            Error::from_error_kind(i, e)
84
8
          })))
Unexecuted instantiation: <nom::bytes::Tag<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Unexecuted instantiation: <nom::bytes::Tag<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Unexecuted instantiation: <nom::bytes::Tag<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Unexecuted instantiation: <nom::bytes::Tag<&[u8], ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
<nom::bytes::Tag<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
81
334k
          Err(Err::Error(OM::Error::bind(|| {
82
334k
            let e: ErrorKind = ErrorKind::Tag;
83
334k
            Error::from_error_kind(i, e)
84
334k
          })))
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
81
33.3k
          Err(Err::Error(OM::Error::bind(|| {
82
33.3k
            let e: ErrorKind = ErrorKind::Tag;
83
33.3k
            Error::from_error_kind(i, e)
84
33.3k
          })))
Unexecuted instantiation: <nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Unexecuted instantiation: <nom::bytes::Tag<&str, suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
<nom::bytes::Tag<&str, suricata::detect::error::RuleParseError<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
81
118k
          Err(Err::Error(OM::Error::bind(|| {
82
118k
            let e: ErrorKind = ErrorKind::Tag;
83
118k
            Error::from_error_kind(i, e)
84
118k
          })))
Unexecuted instantiation: <nom::bytes::Tag<&str, ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Unexecuted instantiation: <nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
81
972k
          Err(Err::Error(OM::Error::bind(|| {
82
972k
            let e: ErrorKind = ErrorKind::Tag;
83
972k
            Error::from_error_kind(i, e)
84
972k
          })))
Unexecuted instantiation: <nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Unexecuted instantiation: <nom::bytes::Tag<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#1}
85
        }
86
      }
87
99.9M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
99.9M
        let e: ErrorKind = ErrorKind::Tag;
89
99.9M
        Error::from_error_kind(i, e)
90
99.9M
      }))),
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
87
75.4k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
75.4k
        let e: ErrorKind = ErrorKind::Tag;
89
75.4k
        Error::from_error_kind(i, e)
90
75.4k
      }))),
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
5.51k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
5.51k
        let e: ErrorKind = ErrorKind::Tag;
89
5.51k
        Error::from_error_kind(i, e)
90
5.51k
      }))),
<nom::bytes::Tag<&[u8], nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
87
12.4k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
12.4k
        let e: ErrorKind = ErrorKind::Tag;
89
12.4k
        Error::from_error_kind(i, e)
90
12.4k
      }))),
<nom::bytes::Tag<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
171k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
171k
        let e: ErrorKind = ErrorKind::Tag;
89
171k
        Error::from_error_kind(i, e)
90
171k
      }))),
<nom::bytes::Tag<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
86
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
86
        let e: ErrorKind = ErrorKind::Tag;
89
86
        Error::from_error_kind(i, e)
90
86
      }))),
Unexecuted instantiation: <nom::bytes::Tag<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Unexecuted instantiation: <nom::bytes::Tag<&[u8], ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
<nom::bytes::Tag<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
87
2.11M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
2.11M
        let e: ErrorKind = ErrorKind::Tag;
89
2.11M
        Error::from_error_kind(i, e)
90
2.11M
      }))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
87
75.7k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
75.7k
        let e: ErrorKind = ErrorKind::Tag;
89
75.7k
        Error::from_error_kind(i, e)
90
75.7k
      }))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
3.49k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
3.49k
        let e: ErrorKind = ErrorKind::Tag;
89
3.49k
        Error::from_error_kind(i, e)
90
3.49k
      }))),
<nom::bytes::Tag<&str, suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
17.1k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
17.1k
        let e: ErrorKind = ErrorKind::Tag;
89
17.1k
        Error::from_error_kind(i, e)
90
17.1k
      }))),
Unexecuted instantiation: <nom::bytes::Tag<&str, suricata::detect::error::RuleParseError<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
<nom::bytes::Tag<&str, ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
285
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
285
        let e: ErrorKind = ErrorKind::Tag;
89
285
        Error::from_error_kind(i, e)
90
285
      }))),
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
74.1k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
74.1k
        let e: ErrorKind = ErrorKind::Tag;
89
74.1k
        Error::from_error_kind(i, e)
90
74.1k
      }))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
87
59.2M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
59.2M
        let e: ErrorKind = ErrorKind::Tag;
89
59.2M
        Error::from_error_kind(i, e)
90
59.2M
      }))),
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
87
38.1M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
38.1M
        let e: ErrorKind = ErrorKind::Tag;
89
38.1M
        Error::from_error_kind(i, e)
90
38.1M
      }))),
Unexecuted instantiation: <nom::bytes::Tag<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#2}
91
    }
92
132M
  }
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
71
88.2k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
88.2k
    let tag_len = self.tag.input_len();
73
88.2k
    let t = self.tag.clone();
74
75
88.2k
    match i.compare(t) {
76
12.6k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
56
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
56
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
75.4k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
88.2k
  }
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
3.57M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
3.57M
    let tag_len = self.tag.input_len();
73
3.57M
    let t = self.tag.clone();
74
75
3.57M
    match i.compare(t) {
76
3.56M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
618
        if OM::Incomplete::is_streaming() {
79
618
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
5.51k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
3.57M
  }
<nom::bytes::Tag<&[u8], nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
71
14.2k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
14.2k
    let tag_len = self.tag.input_len();
73
14.2k
    let t = self.tag.clone();
74
75
14.2k
    match i.compare(t) {
76
1.81k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
8
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
8
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
12.4k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
14.2k
  }
<nom::bytes::Tag<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
2.03M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
2.03M
    let tag_len = self.tag.input_len();
73
2.03M
    let t = self.tag.clone();
74
75
2.03M
    match i.compare(t) {
76
1.85M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
5.99k
        if OM::Incomplete::is_streaming() {
79
5.99k
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
171k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
2.03M
  }
<nom::bytes::Tag<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
936
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
936
    let tag_len = self.tag.input_len();
73
936
    let t = self.tag.clone();
74
75
936
    match i.compare(t) {
76
844
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
6
        if OM::Incomplete::is_streaming() {
79
6
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
86
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
936
  }
<nom::bytes::Tag<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
30.0k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
30.0k
    let tag_len = self.tag.input_len();
73
30.0k
    let t = self.tag.clone();
74
75
30.0k
    match i.compare(t) {
76
30.0k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
0
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
0
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
30.0k
  }
<nom::bytes::Tag<&[u8], ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
17
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
17
    let tag_len = self.tag.input_len();
73
17
    let t = self.tag.clone();
74
75
17
    match i.compare(t) {
76
17
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
0
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
0
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
17
  }
<nom::bytes::Tag<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
71
2.64M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
2.64M
    let tag_len = self.tag.input_len();
73
2.64M
    let t = self.tag.clone();
74
75
2.64M
    match i.compare(t) {
76
196k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
334k
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
334k
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
2.11M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
2.64M
  }
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
71
606k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
606k
    let tag_len = self.tag.input_len();
73
606k
    let t = self.tag.clone();
74
75
606k
    match i.compare(t) {
76
497k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
33.3k
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
33.3k
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
75.7k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
606k
  }
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
36.9k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
36.9k
    let tag_len = self.tag.input_len();
73
36.9k
    let t = self.tag.clone();
74
75
36.9k
    match i.compare(t) {
76
33.3k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
64
        if OM::Incomplete::is_streaming() {
79
64
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
3.49k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
36.9k
  }
<nom::bytes::Tag<&str, suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
20.5k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
20.5k
    let tag_len = self.tag.input_len();
73
20.5k
    let t = self.tag.clone();
74
75
20.5k
    match i.compare(t) {
76
1.80k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
1.56k
        if OM::Incomplete::is_streaming() {
79
1.56k
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
17.1k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
20.5k
  }
<nom::bytes::Tag<&str, suricata::detect::error::RuleParseError<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
71
557k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
557k
    let tag_len = self.tag.input_len();
73
557k
    let t = self.tag.clone();
74
75
557k
    match i.compare(t) {
76
439k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
118k
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
118k
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
0
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
557k
  }
<nom::bytes::Tag<&str, ()> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
330
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
330
    let tag_len = self.tag.input_len();
73
330
    let t = self.tag.clone();
74
75
330
    match i.compare(t) {
76
17
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
28
        if OM::Incomplete::is_streaming() {
79
28
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
285
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
330
  }
<nom::bytes::Tag<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
102k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
102k
    let tag_len = self.tag.input_len();
73
102k
    let t = self.tag.clone();
74
75
102k
    match i.compare(t) {
76
27.1k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
714
        if OM::Incomplete::is_streaming() {
79
714
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
74.1k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
102k
  }
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
71
78.5M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
78.5M
    let tag_len = self.tag.input_len();
73
78.5M
    let t = self.tag.clone();
74
75
78.5M
    match i.compare(t) {
76
18.2M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
972k
        if OM::Incomplete::is_streaming() {
79
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
972k
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
59.2M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
78.5M
  }
<nom::bytes::Tag<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
71
44.6M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
72
44.6M
    let tag_len = self.tag.input_len();
73
44.6M
    let t = self.tag.clone();
74
75
44.6M
    match i.compare(t) {
76
6.46M
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
77
      CompareResult::Incomplete => {
78
51.1k
        if OM::Incomplete::is_streaming() {
79
51.1k
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
80
        } else {
81
0
          Err(Err::Error(OM::Error::bind(|| {
82
            let e: ErrorKind = ErrorKind::Tag;
83
            Error::from_error_kind(i, e)
84
          })))
85
        }
86
      }
87
38.1M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
88
        let e: ErrorKind = ErrorKind::Tag;
89
        Error::from_error_kind(i, e)
90
      }))),
91
    }
92
44.6M
  }
Unexecuted instantiation: <nom::bytes::Tag<_, _> as nom::internal::Parser<_>>::process::<_>
93
}
94
95
/// Recognizes a case insensitive pattern.
96
///
97
/// The input data will be compared to the tag combinator's argument and will return the part of
98
/// the input that matches the argument with no regard to case.
99
/// # Example
100
/// ```rust
101
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
102
/// use nom::bytes::streaming::tag_no_case;
103
///
104
/// fn parser(s: &str) -> IResult<&str, &str> {
105
///   tag_no_case("hello")(s)
106
/// }
107
///
108
/// assert_eq!(parser("Hello, World!"), Ok((", World!", "Hello")));
109
/// assert_eq!(parser("hello, World!"), Ok((", World!", "hello")));
110
/// assert_eq!(parser("HeLlO, World!"), Ok((", World!", "HeLlO")));
111
/// assert_eq!(parser("Something"), Err(Err::Error(Error::new("Something", ErrorKind::Tag))));
112
/// assert_eq!(parser(""), Err(Err::Incomplete(Needed::new(5))));
113
/// ```
114
0
pub fn tag_no_case<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
115
0
where
116
0
  I: Input + Compare<T>,
117
0
  T: Input + Clone,
118
{
119
0
  TagNoCase {
120
0
    tag,
121
0
    e: PhantomData,
122
0
  }
123
0
}
124
125
/// Case insensitive Tag implementation
126
pub struct TagNoCase<T, E> {
127
  tag: T,
128
  e: PhantomData<E>,
129
}
130
131
impl<I, Error: ParseError<I>, T> Parser<I> for TagNoCase<T, Error>
132
where
133
  I: Input + Compare<T>,
134
  T: Input + Clone,
135
{
136
  type Output = I;
137
138
  type Error = Error;
139
140
4.49M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
141
4.49M
    let tag_len = self.tag.input_len();
142
4.49M
    let t = self.tag.clone();
143
144
4.49M
    match i.compare_no_case(t) {
145
495k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::TagNoCase<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
145
7.44k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
<nom::bytes::TagNoCase<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
145
487k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
Unexecuted instantiation: <nom::bytes::TagNoCase<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
146
      CompareResult::Incomplete => {
147
1.71M
        if OM::Incomplete::is_streaming() {
148
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
149
        } else {
150
1.71M
          Err(Err::Error(OM::Error::bind(|| {
151
1.71M
            let e: ErrorKind = ErrorKind::Tag;
152
1.71M
            Error::from_error_kind(i, e)
153
1.71M
          })))
<nom::bytes::TagNoCase<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
150
1.61M
          Err(Err::Error(OM::Error::bind(|| {
151
1.61M
            let e: ErrorKind = ErrorKind::Tag;
152
1.61M
            Error::from_error_kind(i, e)
153
1.61M
          })))
<nom::bytes::TagNoCase<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
150
101k
          Err(Err::Error(OM::Error::bind(|| {
151
101k
            let e: ErrorKind = ErrorKind::Tag;
152
101k
            Error::from_error_kind(i, e)
153
101k
          })))
Unexecuted instantiation: <nom::bytes::TagNoCase<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#1}
154
        }
155
      }
156
2.28M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
157
2.28M
        let e: ErrorKind = ErrorKind::Tag;
158
2.28M
        Error::from_error_kind(i, e)
159
2.28M
      }))),
<nom::bytes::TagNoCase<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
156
415k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
157
415k
        let e: ErrorKind = ErrorKind::Tag;
158
415k
        Error::from_error_kind(i, e)
159
415k
      }))),
<nom::bytes::TagNoCase<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
156
1.86M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
157
1.86M
        let e: ErrorKind = ErrorKind::Tag;
158
1.86M
        Error::from_error_kind(i, e)
159
1.86M
      }))),
Unexecuted instantiation: <nom::bytes::TagNoCase<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#2}
160
    }
161
4.49M
  }
<nom::bytes::TagNoCase<&str, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
140
2.03M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
141
2.03M
    let tag_len = self.tag.input_len();
142
2.03M
    let t = self.tag.clone();
143
144
2.03M
    match i.compare_no_case(t) {
145
7.44k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
146
      CompareResult::Incomplete => {
147
1.61M
        if OM::Incomplete::is_streaming() {
148
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
149
        } else {
150
1.61M
          Err(Err::Error(OM::Error::bind(|| {
151
            let e: ErrorKind = ErrorKind::Tag;
152
            Error::from_error_kind(i, e)
153
          })))
154
        }
155
      }
156
415k
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
157
        let e: ErrorKind = ErrorKind::Tag;
158
        Error::from_error_kind(i, e)
159
      }))),
160
    }
161
2.03M
  }
<nom::bytes::TagNoCase<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
140
2.45M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
141
2.45M
    let tag_len = self.tag.input_len();
142
2.45M
    let t = self.tag.clone();
143
144
2.45M
    match i.compare_no_case(t) {
145
487k
      CompareResult::Ok => Ok((i.take_from(tag_len), OM::Output::bind(|| i.take(tag_len)))),
146
      CompareResult::Incomplete => {
147
101k
        if OM::Incomplete::is_streaming() {
148
0
          Err(Err::Incomplete(Needed::new(tag_len - i.input_len())))
149
        } else {
150
101k
          Err(Err::Error(OM::Error::bind(|| {
151
            let e: ErrorKind = ErrorKind::Tag;
152
            Error::from_error_kind(i, e)
153
          })))
154
        }
155
      }
156
1.86M
      CompareResult::Error => Err(Err::Error(OM::Error::bind(|| {
157
        let e: ErrorKind = ErrorKind::Tag;
158
        Error::from_error_kind(i, e)
159
      }))),
160
    }
161
2.45M
  }
Unexecuted instantiation: <nom::bytes::TagNoCase<_, _> as nom::internal::Parser<_>>::process::<_>
162
}
163
164
/// Parser wrapper for `split_at_position`
165
pub struct SplitPosition<F, E> {
166
  predicate: F,
167
  error: PhantomData<E>,
168
}
169
170
impl<I, Error: ParseError<I>, F> Parser<I> for SplitPosition<F, Error>
171
where
172
  I: Input,
173
  F: Fn(<I as Input>::Item) -> bool,
174
{
175
  type Output = I;
176
177
  type Error = Error;
178
179
  #[inline(always)]
180
64.3M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
695M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
181k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
125k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
15.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
Unexecuted instantiation: <nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
13.9k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u8>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
3.94k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u32>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
7.72k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
8.12k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u64>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
4.15k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
27.6k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
9.91k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
10.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
280
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
1.96k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
179
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_inclusive<u32>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
3.53k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::float::detect_parse_float<f64>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
299
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::ike::detect::ike_detect_chosen_sa_parse_aux::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
41.6k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::krb::detect::detect_parse_encryption::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
466
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_attributes::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
133k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
35.6k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#2}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
11.3k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#3}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
15.0k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
35.2k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_connection_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
10.3k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_connection_data::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
13.8k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::stream_size::detect_parse_stream_size::{closure#1}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
501
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uri::detect_parse_urilen::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
1.45k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::requires::parse_key_value::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
287k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_time_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
3.53k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_token_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
24.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_ipaddr_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
41.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
3.63k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_session_name_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
37.4k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::mime::mime::is_mime_space, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
5.23M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::pop3::pop3::is_base64_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
510
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
Unexecuted instantiation: <nom::bytes::SplitPosition<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#1}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
<nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_header_line::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
28.8M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata::mime::mime::mime_skip_value_until_semicolon::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
63.1M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata::detect::requires::parse_key_value::{closure#1}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
699k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata::detect::requires::parse_next_version_part::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
263k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata::sdp::parser::is_line_ending, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
396k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::hcolon::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
331k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::hcolon::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
556k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::tftp::tftp::getstr::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
15.8k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::is_header_name, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
2.25M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::is_method_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
146k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
391k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::ssh::parser::is_not_lineend, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
188k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_skip_line::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
2.27M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_boundary_regular::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
226k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::is_token, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
22.7M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<<suricata_htp::headers::Parser>::is_eol::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
198M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata_htp::util::take_till_lf::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
239M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata_htp::util::take_till_eol::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
46.0M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata_htp::util::take_till_lf_null::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
531
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
Unexecuted instantiation: <nom::bytes::SplitPosition<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
<nom::bytes::SplitPosition<<suricata_htp::connection_parser::ConnectionParser>::response_body_determine::{closure#2}, (&[u8], nom::error::ErrorKind)> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
181
592k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::hex_digits::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
222k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_ascii_whitespace::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
900k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
Unexecuted instantiation: <nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_until_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::nom_take_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
532k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_not_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
64.0M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_is_space_or_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
3.10M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::parsers::protocol_version::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
129k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::is_chunked_ctl_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
113k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::is_space, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
9.63M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata_htp::parsers::content_type::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
1.17M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata_htp::parsers::query::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
1.63M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
<nom::bytes::SplitPosition<suricata_htp::util::ascii_digits::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
181
1.10M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
64.3M
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
14.8k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
14.8k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
14.8k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
21.1k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
21.1k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
21.1k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
130
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
130
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
130
  }
Unexecuted instantiation: <nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::parse_flag_list<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
92
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
92
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
92
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u8>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
35.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
35.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
35.7k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u32>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
43.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
43.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
43.7k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
63.9k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
63.9k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
63.9k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint<u64>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
25.3k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
25.3k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
25.3k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
27.6k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
27.6k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
27.6k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
6.15k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
6.15k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
6.15k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
10.6k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
10.6k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
10.6k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
138
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
138
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
138
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
1.66k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
1.66k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
1.66k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
99
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
99
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
99
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uint::detect_parse_uint_inclusive<u32>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
18.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
18.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
18.7k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::float::detect_parse_float<f64>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
4.60k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
4.60k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
4.60k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::ike::detect::ike_detect_chosen_sa_parse_aux::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
2.43k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
2.43k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
2.43k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::krb::detect::detect_parse_encryption::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.78k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.78k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.78k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_attributes::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
19.1k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
19.1k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
19.1k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.84k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.84k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.84k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#2}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.71k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.71k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.71k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#3}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.70k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.70k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.70k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_origin_line::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.78k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.78k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.78k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_connection_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.46k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.46k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.46k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::parse_connection_data::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.46k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.46k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.46k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::stream_size::detect_parse_stream_size::{closure#1}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
5.18k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
5.18k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
5.18k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::uri::detect_parse_urilen::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
7.19k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
7.19k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
7.19k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::detect::requires::parse_key_value::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
46.5k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
46.5k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
46.5k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_time_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
601
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
601
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
601
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_token_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.90k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.90k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.90k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_ipaddr_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.44k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.44k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.44k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
158
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
158
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
158
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sdp::parser::is_session_name_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
3.75k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.75k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.75k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::mime::mime::is_mime_space, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
11.0M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
11.0M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
11.0M
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::pop3::pop3::is_base64_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
6
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
6
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
6
  }
Unexecuted instantiation: <nom::bytes::SplitPosition<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#1}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
<nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_header_line::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
6.39M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
6.39M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
6.39M
  }
<nom::bytes::SplitPosition<suricata::mime::mime::mime_skip_value_until_semicolon::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
2.38M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
2.38M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
2.38M
  }
<nom::bytes::SplitPosition<suricata::detect::requires::parse_key_value::{closure#1}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
46.5k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
46.5k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
46.5k
  }
<nom::bytes::SplitPosition<suricata::detect::requires::parse_next_version_part::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
123k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
123k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
123k
  }
<nom::bytes::SplitPosition<suricata::sdp::parser::is_line_ending, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
20.4k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
20.4k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
20.4k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::hcolon::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
331k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
331k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
331k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::hcolon::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
330k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
330k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
330k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::tftp::tftp::getstr::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
1.74k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
1.74k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
1.74k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::is_header_name, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
331k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
331k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
331k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::is_method_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
25.1k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
25.1k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
25.1k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
8.12k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
8.12k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
8.12k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata::ssh::parser::is_not_lineend, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
2.33k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
2.33k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
2.33k
  }
<nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_skip_line::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
75.1k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
75.1k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
75.1k
  }
<nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_boundary_regular::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
12.2k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
12.2k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
12.2k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::is_token, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
3.78M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
3.78M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
3.78M
  }
<nom::bytes::SplitPosition<<suricata_htp::headers::Parser>::is_eol::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
9.64M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
9.64M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
9.64M
  }
<nom::bytes::SplitPosition<suricata_htp::util::take_till_lf::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
9.88M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
9.88M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
9.88M
  }
<nom::bytes::SplitPosition<suricata_htp::util::take_till_eol::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
1.83M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
1.83M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
1.83M
  }
<nom::bytes::SplitPosition<suricata_htp::util::take_till_lf_null::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
141
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
141
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
141
  }
Unexecuted instantiation: <nom::bytes::SplitPosition<_, _> as nom::internal::Parser<_>>::process::<_>
<nom::bytes::SplitPosition<<suricata_htp::connection_parser::ConnectionParser>::response_body_determine::{closure#2}, (&[u8], nom::error::ErrorKind)> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
180
25.4k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
25.4k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
25.4k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::hex_digits::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
94.9k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
94.9k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
94.9k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_ascii_whitespace::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
892k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
892k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
892k
  }
Unexecuted instantiation: <nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_until_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::nom_take_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
733k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
733k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
733k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_not_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
6.24M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
6.24M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
6.24M
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::take_is_space_or_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
2.05M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
2.05M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
2.05M
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::parsers::protocol_version::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
130k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
130k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
130k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::is_chunked_ctl_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
100k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
100k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
100k
  }
<nom::bytes::SplitPosition<nom::bytes::take_while<suricata_htp::util::is_space, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
7.10M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
7.10M
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
7.10M
  }
<nom::bytes::SplitPosition<suricata_htp::parsers::content_type::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
37.0k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
37.0k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
37.0k
  }
<nom::bytes::SplitPosition<suricata_htp::parsers::query::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
29.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
29.7k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
29.7k
  }
<nom::bytes::SplitPosition<suricata_htp::util::ascii_digits::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
180
276k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
181
276k
    i.split_at_position_mode::<OM, _, _>(|c| (self.predicate)(c))
182
276k
  }
183
}
184
185
/// Parser wrapper for `split_at_position1`
186
pub struct SplitPosition1<F, E> {
187
  e: ErrorKind,
188
  predicate: F,
189
  error: PhantomData<E>,
190
}
191
192
impl<I, Error: ParseError<I>, F> Parser<I> for SplitPosition1<F, Error>
193
where
194
  I: Input,
195
  F: Fn(<I as Input>::Item) -> bool,
196
{
197
  type Output = I;
198
199
  type Error = Error;
200
201
  #[inline(always)]
202
3.07M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
52.5M
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::applayertemplate::template::probe::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
20.5k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::util::is_alphanumeric_or_hyphen, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
10.6M
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::krb::detect::is_alphanumeric_or_dash, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
298k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::is_a<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
1.37M
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
287k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}, suricata::detect::error::RuleParseError<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
5.96M
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
203
83.6k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::sip::parser::is_version_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
203
113k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
203
861k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::sip::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
203
625k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::take_while1<<suricata_htp::headers::Parser>::complete_eol_deformed::{closure#0}::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
203
87.0k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
32.1M
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
Unexecuted instantiation: <nom::bytes::SplitPosition1<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata_htp::util::is_valid_chunked_length_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
203
7.30k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
3.07M
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::applayertemplate::template::probe::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
11.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
11.7k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
11.7k
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::util::is_alphanumeric_or_hyphen, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
15.4k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
15.4k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
15.4k
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::krb::detect::is_alphanumeric_or_dash, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
40.8k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
40.8k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
40.8k
  }
<nom::bytes::SplitPosition1<nom::bytes::is_a<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
1.29M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
1.29M
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
1.29M
  }
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
10.6k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
10.6k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
10.6k
  }
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}, suricata::detect::error::RuleParseError<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
864k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
864k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
864k
  }
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
202
1.93k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
1.93k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
1.93k
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::sip::parser::is_version_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
202
27.9k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
27.9k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
27.9k
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
202
21.4k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
21.4k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
21.4k
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata::sip::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
202
24.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
24.7k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
24.7k
  }
<nom::bytes::SplitPosition1<nom::bytes::take_while1<<suricata_htp::headers::Parser>::complete_eol_deformed::{closure#0}::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
202
61.6k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
61.6k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
61.6k
  }
<nom::bytes::SplitPosition1<nom::bytes::is_not<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
690k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
690k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
690k
  }
Unexecuted instantiation: <nom::bytes::SplitPosition1<_, _> as nom::internal::Parser<_>>::process::<_>
<nom::bytes::SplitPosition1<nom::bytes::take_while1<suricata_htp::util::is_valid_chunked_length_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
202
5.88k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
203
5.88k
    i.split_at_position_mode1::<OM, _, _>(|c| (self.predicate)(c), self.e)
204
5.88k
  }
205
}
206
207
/// Parse till certain characters are met.
208
///
209
/// The parser will return the longest slice till one of the characters of the combinator's argument are met.
210
///
211
/// It doesn't consume the matched character.
212
///
213
/// It will return a `Err::Error(("", ErrorKind::IsNot))` if the pattern wasn't met.
214
/// # Example
215
/// ```rust
216
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
217
/// use nom::bytes::complete::is_not;
218
///
219
/// fn not_space(s: &str) -> IResult<&str, &str> {
220
///   is_not(" \t\r\n")(s)
221
/// }
222
///
223
/// assert_eq!(not_space("Hello, World!"), Ok((" World!", "Hello,")));
224
/// assert_eq!(not_space("Sometimes\t"), Ok(("\t", "Sometimes")));
225
/// assert_eq!(not_space("Nospace"), Ok(("", "Nospace")));
226
/// assert_eq!(not_space(""), Err(Err::Error(Error::new("", ErrorKind::IsNot))));
227
/// ```
228
1.56M
pub fn is_not<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
229
1.56M
where
230
1.56M
  I: Input,
231
1.56M
  T: FindToken<<I as Input>::Item>,
232
{
233
  SplitPosition1 {
234
1.56M
    e: ErrorKind::IsNot,
235
38.5M
    predicate: move |c| arr.find_token(c),
nom::bytes::is_not::<&str, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
235
287k
    predicate: move |c| arr.find_token(c),
nom::bytes::is_not::<&str, &str, suricata::detect::error::RuleParseError<&str>>::{closure#0}
Line
Count
Source
235
5.96M
    predicate: move |c| arr.find_token(c),
nom::bytes::is_not::<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
235
83.6k
    predicate: move |c| arr.find_token(c),
nom::bytes::is_not::<&str, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
235
32.1M
    predicate: move |c| arr.find_token(c),
Unexecuted instantiation: nom::bytes::is_not::<_, _, _>::{closure#0}
236
1.56M
    error: PhantomData,
237
  }
238
1.56M
}
nom::bytes::is_not::<&str, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
228
1.93k
pub fn is_not<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
229
1.93k
where
230
1.93k
  I: Input,
231
1.93k
  T: FindToken<<I as Input>::Item>,
232
{
233
  SplitPosition1 {
234
1.93k
    e: ErrorKind::IsNot,
235
    predicate: move |c| arr.find_token(c),
236
1.93k
    error: PhantomData,
237
  }
238
1.93k
}
nom::bytes::is_not::<&str, &str, nom::error::Error<&str>>
Line
Count
Source
228
10.6k
pub fn is_not<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
229
10.6k
where
230
10.6k
  I: Input,
231
10.6k
  T: FindToken<<I as Input>::Item>,
232
{
233
  SplitPosition1 {
234
10.6k
    e: ErrorKind::IsNot,
235
    predicate: move |c| arr.find_token(c),
236
10.6k
    error: PhantomData,
237
  }
238
10.6k
}
nom::bytes::is_not::<&str, &str, suricata::detect::error::RuleParseError<&str>>
Line
Count
Source
228
425k
pub fn is_not<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
229
425k
where
230
425k
  I: Input,
231
425k
  T: FindToken<<I as Input>::Item>,
232
{
233
  SplitPosition1 {
234
425k
    e: ErrorKind::IsNot,
235
    predicate: move |c| arr.find_token(c),
236
425k
    error: PhantomData,
237
  }
238
425k
}
nom::bytes::is_not::<&str, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
228
1.12M
pub fn is_not<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
229
1.12M
where
230
1.12M
  I: Input,
231
1.12M
  T: FindToken<<I as Input>::Item>,
232
{
233
  SplitPosition1 {
234
1.12M
    e: ErrorKind::IsNot,
235
    predicate: move |c| arr.find_token(c),
236
1.12M
    error: PhantomData,
237
  }
238
1.12M
}
Unexecuted instantiation: nom::bytes::is_not::<_, _, _>
239
240
/// Returns the longest slice of the matches the pattern.
241
///
242
/// The parser will return the longest slice consisting of the characters in provided in the
243
/// combinator's argument.
244
///
245
/// It will return a `Err(Err::Error((_, ErrorKind::IsA)))` if the pattern wasn't met.
246
/// # Example
247
/// ```rust
248
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
249
/// use nom::bytes::complete::is_a;
250
///
251
/// fn hex(s: &str) -> IResult<&str, &str> {
252
///   is_a("1234567890ABCDEF")(s)
253
/// }
254
///
255
/// assert_eq!(hex("123 and voila"), Ok((" and voila", "123")));
256
/// assert_eq!(hex("DEADBEEF and others"), Ok((" and others", "DEADBEEF")));
257
/// assert_eq!(hex("BADBABEsomething"), Ok(("something", "BADBABE")));
258
/// assert_eq!(hex("D15EA5E"), Ok(("", "D15EA5E")));
259
/// assert_eq!(hex(""), Err(Err::Error(Error::new("", ErrorKind::IsA))));
260
/// ```
261
1.29M
pub fn is_a<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
262
1.29M
where
263
1.29M
  I: Input,
264
1.29M
  T: FindToken<<I as Input>::Item>,
265
{
266
  SplitPosition1 {
267
1.29M
    e: ErrorKind::IsA,
268
1.37M
    predicate: move |c| !arr.find_token(c),
nom::bytes::is_a::<&str, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
268
1.37M
    predicate: move |c| !arr.find_token(c),
Unexecuted instantiation: nom::bytes::is_a::<_, _, _>::{closure#0}
269
1.29M
    error: PhantomData,
270
  }
271
1.29M
}
nom::bytes::is_a::<&str, &str, nom::error::Error<&str>>
Line
Count
Source
261
1.29M
pub fn is_a<T, I, Error: ParseError<I>>(arr: T) -> impl Parser<I, Output = I, Error = Error>
262
1.29M
where
263
1.29M
  I: Input,
264
1.29M
  T: FindToken<<I as Input>::Item>,
265
{
266
  SplitPosition1 {
267
1.29M
    e: ErrorKind::IsA,
268
    predicate: move |c| !arr.find_token(c),
269
1.29M
    error: PhantomData,
270
  }
271
1.29M
}
Unexecuted instantiation: nom::bytes::is_a::<_, _, _>
272
273
/// Returns the longest input slice (if any) that matches the predicate.
274
///
275
/// The parser will return the longest slice that matches the given predicate *(a function that
276
/// takes the input and returns a bool)*.
277
/// # Example
278
/// ```rust
279
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
280
/// use nom::bytes::complete::take_while;
281
/// use nom::character::is_alphabetic;
282
///
283
/// fn alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
284
///   take_while(is_alphabetic)(s)
285
/// }
286
///
287
/// assert_eq!(alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));
288
/// assert_eq!(alpha(b"12345"), Ok((&b"12345"[..], &b""[..])));
289
/// assert_eq!(alpha(b"latin"), Ok((&b""[..], &b"latin"[..])));
290
/// assert_eq!(alpha(b""), Ok((&b""[..], &b""[..])));
291
/// ```
292
33.8M
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
33.8M
where
294
33.8M
  I: Input,
295
33.8M
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
111M
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
181k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
125k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
15.7k
    predicate: move |c| !cond(c),
Unexecuted instantiation: nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
13.9k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u8>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
3.94k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u32>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
7.72k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
8.12k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u64>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
4.15k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
27.6k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
9.91k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
10.7k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
280
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
1.96k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
179
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_inclusive<u32>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
3.53k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::float::detect_parse_float<f64>::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
299
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::ike::detect::ike_detect_chosen_sa_parse_aux::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
41.6k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::krb::detect::detect_parse_encryption::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
466
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_attributes::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
133k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
35.6k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#2}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
11.3k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#3}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
15.0k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
35.2k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_connection_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
10.3k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::parse_connection_data::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
13.8k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::stream_size::detect_parse_stream_size::{closure#1}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
501
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::uri::detect_parse_urilen::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
1.45k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::detect::requires::parse_key_value::{closure#0}, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
298
287k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::is_time_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
3.53k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::is_token_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
24.7k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::is_ipaddr_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
41.7k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
3.63k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sdp::parser::is_session_name_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
37.4k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::mime::mime::is_mime_space, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
5.23M
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::pop3::pop3::is_base64_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
510
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sip::parser::hcolon::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
331k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sip::parser::hcolon::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
556k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::tftp::tftp::getstr::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
15.8k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sip::parser::is_header_name, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
2.25M
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sip::parser::is_method_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
146k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
391k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata::ssh::parser::is_not_lineend, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
188k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::util::is_token, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
22.7M
    predicate: move |c| !cond(c),
Unexecuted instantiation: nom::bytes::take_while::<_, _, _>::{closure#0}
nom::bytes::take_while::<suricata_htp::util::hex_digits::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
222k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::util::take_ascii_whitespace::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
900k
    predicate: move |c| !cond(c),
Unexecuted instantiation: nom::bytes::take_while::<suricata_htp::util::take_until_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
nom::bytes::take_while::<suricata_htp::util::nom_take_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
532k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::util::take_not_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
64.0M
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::util::take_is_space_or_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
3.10M
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::parsers::protocol_version::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
129k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::util::is_chunked_ctl_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
113k
    predicate: move |c| !cond(c),
nom::bytes::take_while::<suricata_htp::util::is_space, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
298
9.63M
    predicate: move |c| !cond(c),
299
33.8M
    error: PhantomData,
300
  }
301
33.8M
}
nom::bytes::take_while::<suricata::krb::detect::detect_parse_encryption::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
3.78k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.78k
where
294
3.78k
  I: Input,
295
3.78k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.78k
    error: PhantomData,
300
  }
301
3.78k
}
nom::bytes::take_while::<suricata::detect::stream_size::detect_parse_stream_size::{closure#1}, &str, nom::error::Error<&str>>
Line
Count
Source
292
5.18k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
5.18k
where
294
5.18k
  I: Input,
295
5.18k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
5.18k
    error: PhantomData,
300
  }
301
5.18k
}
nom::bytes::take_while::<suricata::ssh::parser::is_not_lineend, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
2.33k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
2.33k
where
294
2.33k
  I: Input,
295
2.33k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
2.33k
    error: PhantomData,
300
  }
301
2.33k
}
nom::bytes::take_while::<suricata::sip::parser::hcolon::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
331k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
331k
where
294
331k
  I: Input,
295
331k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
331k
    error: PhantomData,
300
  }
301
331k
}
nom::bytes::take_while::<suricata::sip::parser::hcolon::{closure#1}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
331k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
331k
where
294
331k
  I: Input,
295
331k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
331k
    error: PhantomData,
300
  }
301
331k
}
nom::bytes::take_while::<suricata::sip::parser::is_header_name, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
331k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
331k
where
294
331k
  I: Input,
295
331k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
331k
    error: PhantomData,
300
  }
301
331k
}
nom::bytes::take_while::<suricata::sip::parser::is_method_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
25.1k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
25.1k
where
294
25.1k
  I: Input,
295
25.1k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
25.1k
    error: PhantomData,
300
  }
301
25.1k
}
nom::bytes::take_while::<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
8.12k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
8.12k
where
294
8.12k
  I: Input,
295
8.12k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
8.12k
    error: PhantomData,
300
  }
301
8.12k
}
nom::bytes::take_while::<suricata::detect::uri::detect_parse_urilen::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
7.19k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
7.19k
where
294
7.19k
  I: Input,
295
7.19k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
7.19k
    error: PhantomData,
300
  }
301
7.19k
}
nom::bytes::take_while::<suricata::ike::detect::ike_detect_chosen_sa_parse_aux::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
2.43k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
2.43k
where
294
2.43k
  I: Input,
295
2.43k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
2.43k
    error: PhantomData,
300
  }
301
2.43k
}
nom::bytes::take_while::<suricata::mime::mime::is_mime_space, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
11.0M
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
11.0M
where
294
11.0M
  I: Input,
295
11.0M
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
11.0M
    error: PhantomData,
300
  }
301
11.0M
}
nom::bytes::take_while::<suricata::detect::requires::parse_key_value::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
46.5k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
46.5k
where
294
46.5k
  I: Input,
295
46.5k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
46.5k
    error: PhantomData,
300
  }
301
46.5k
}
nom::bytes::take_while::<suricata::tftp::tftp::getstr::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
1.74k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
1.74k
where
294
1.74k
  I: Input,
295
1.74k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
1.74k
    error: PhantomData,
300
  }
301
1.74k
}
nom::bytes::take_while::<suricata::pop3::pop3::is_base64_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
6
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
6
where
294
6
  I: Input,
295
6
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
6
    error: PhantomData,
300
  }
301
6
}
nom::bytes::take_while::<suricata::sdp::parser::parse_attributes::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
6.39k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
6.39k
where
294
6.39k
  I: Input,
295
6.39k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
6.39k
    error: PhantomData,
300
  }
301
6.39k
}
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.84k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.84k
where
294
3.84k
  I: Input,
295
3.84k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.84k
    error: PhantomData,
300
  }
301
3.84k
}
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#2}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.71k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.71k
where
294
3.71k
  I: Input,
295
3.71k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.71k
    error: PhantomData,
300
  }
301
3.71k
}
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#3}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.70k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.70k
where
294
3.70k
  I: Input,
295
3.70k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.70k
    error: PhantomData,
300
  }
301
3.70k
}
nom::bytes::take_while::<suricata::sdp::parser::parse_origin_line::{closure#1}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.78k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.78k
where
294
3.78k
  I: Input,
295
3.78k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.78k
    error: PhantomData,
300
  }
301
3.78k
}
nom::bytes::take_while::<suricata::sdp::parser::parse_connection_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.46k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.46k
where
294
3.46k
  I: Input,
295
3.46k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.46k
    error: PhantomData,
300
  }
301
3.46k
}
nom::bytes::take_while::<suricata::sdp::parser::parse_connection_data::{closure#1}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.46k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.46k
where
294
3.46k
  I: Input,
295
3.46k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.46k
    error: PhantomData,
300
  }
301
3.46k
}
nom::bytes::take_while::<suricata::sdp::parser::is_time_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
26.7k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
26.7k
where
294
26.7k
  I: Input,
295
26.7k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
26.7k
    error: PhantomData,
300
  }
301
26.7k
}
nom::bytes::take_while::<suricata::sdp::parser::is_token_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.90k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.90k
where
294
3.90k
  I: Input,
295
3.90k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.90k
    error: PhantomData,
300
  }
301
3.90k
}
nom::bytes::take_while::<suricata::sdp::parser::is_ipaddr_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.44k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.44k
where
294
3.44k
  I: Input,
295
3.44k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.44k
    error: PhantomData,
300
  }
301
3.44k
}
nom::bytes::take_while::<suricata::sdp::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
158
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
158
where
294
158
  I: Input,
295
158
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
158
    error: PhantomData,
300
  }
301
158
}
nom::bytes::take_while::<suricata::sdp::parser::is_session_name_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.75k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.75k
where
294
3.75k
  I: Input,
295
3.75k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.75k
    error: PhantomData,
300
  }
301
3.75k
}
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
14.8k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
14.8k
where
294
14.8k
  I: Input,
295
14.8k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
14.8k
    error: PhantomData,
300
  }
301
14.8k
}
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
21.1k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
21.1k
where
294
21.1k
  I: Input,
295
21.1k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
21.1k
    error: PhantomData,
300
  }
301
21.1k
}
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
130
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
130
where
294
130
  I: Input,
295
130
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
130
    error: PhantomData,
300
  }
301
130
}
Unexecuted instantiation: nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>
nom::bytes::take_while::<suricata::detect::uint::parse_flag_list<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
92
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
92
where
294
92
  I: Input,
295
92
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
92
    error: PhantomData,
300
  }
301
92
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u8>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
35.7k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
35.7k
where
294
35.7k
  I: Input,
295
35.7k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
35.7k
    error: PhantomData,
300
  }
301
35.7k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u32>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
43.7k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
43.7k
where
294
43.7k
  I: Input,
295
43.7k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
43.7k
    error: PhantomData,
300
  }
301
43.7k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
63.9k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
63.9k
where
294
63.9k
  I: Input,
295
63.9k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
63.9k
    error: PhantomData,
300
  }
301
63.9k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint<u64>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
25.3k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
25.3k
where
294
25.3k
  I: Input,
295
25.3k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
25.3k
    error: PhantomData,
300
  }
301
25.3k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
27.6k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
27.6k
where
294
27.6k
  I: Input,
295
27.6k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
27.6k
    error: PhantomData,
300
  }
301
27.6k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttConnFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
6.15k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
6.15k
where
294
6.15k
  I: Input,
295
6.15k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
6.15k
    error: PhantomData,
300
  }
301
6.15k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::mqtt::detect::MqttFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
10.6k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
10.6k
where
294
10.6k
  I: Input,
295
10.6k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
10.6k
    error: PhantomData,
300
  }
301
10.6k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u8, suricata::websocket::detect::WebSocketFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
138
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
138
where
294
138
  I: Input,
295
138
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
138
    error: PhantomData,
300
  }
301
138
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::detect::fragbits::Ipv4FragBits>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
1.66k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
1.66k
where
294
1.66k
  I: Input,
295
1.66k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
1.66k
    error: PhantomData,
300
  }
301
1.66k
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_bitflags<u16, suricata::dnp3::detect::Dnp3IndFlag>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
99
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
99
where
294
99
  I: Input,
295
99
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
99
    error: PhantomData,
300
  }
301
99
}
nom::bytes::take_while::<suricata::detect::uint::detect_parse_uint_inclusive<u32>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
18.7k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
18.7k
where
294
18.7k
  I: Input,
295
18.7k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
18.7k
    error: PhantomData,
300
  }
301
18.7k
}
nom::bytes::take_while::<suricata::detect::float::detect_parse_float<f64>::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
292
4.60k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
4.60k
where
294
4.60k
  I: Input,
295
4.60k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
4.60k
    error: PhantomData,
300
  }
301
4.60k
}
nom::bytes::take_while::<suricata_htp::util::hex_digits::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
94.9k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
94.9k
where
294
94.9k
  I: Input,
295
94.9k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
94.9k
    error: PhantomData,
300
  }
301
94.9k
}
nom::bytes::take_while::<suricata_htp::util::take_ascii_whitespace::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
892k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
892k
where
294
892k
  I: Input,
295
892k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
892k
    error: PhantomData,
300
  }
301
892k
}
Unexecuted instantiation: nom::bytes::take_while::<suricata_htp::util::take_until_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>
nom::bytes::take_while::<suricata_htp::util::nom_take_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
733k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
733k
where
294
733k
  I: Input,
295
733k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
733k
    error: PhantomData,
300
  }
301
733k
}
nom::bytes::take_while::<suricata_htp::util::take_not_is_space::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
6.24M
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
6.24M
where
294
6.24M
  I: Input,
295
6.24M
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
6.24M
    error: PhantomData,
300
  }
301
6.24M
}
nom::bytes::take_while::<suricata_htp::util::take_is_space_or_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
2.05M
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
2.05M
where
294
2.05M
  I: Input,
295
2.05M
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
2.05M
    error: PhantomData,
300
  }
301
2.05M
}
nom::bytes::take_while::<suricata_htp::util::is_chunked_ctl_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
100k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
100k
where
294
100k
  I: Input,
295
100k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
100k
    error: PhantomData,
300
  }
301
100k
}
nom::bytes::take_while::<suricata_htp::util::is_space, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
7.10M
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
7.10M
where
294
7.10M
  I: Input,
295
7.10M
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
7.10M
    error: PhantomData,
300
  }
301
7.10M
}
nom::bytes::take_while::<suricata_htp::parsers::protocol_version::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
365k
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
365k
where
294
365k
  I: Input,
295
365k
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
365k
    error: PhantomData,
300
  }
301
365k
}
Unexecuted instantiation: nom::bytes::take_while::<_, _, _>
nom::bytes::take_while::<suricata_htp::util::is_token, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
292
3.79M
pub fn take_while<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
293
3.79M
where
294
3.79M
  I: Input,
295
3.79M
  F: Fn(<I as Input>::Item) -> bool,
296
{
297
  SplitPosition {
298
    predicate: move |c| !cond(c),
299
3.79M
    error: PhantomData,
300
  }
301
3.79M
}
302
303
/// Returns the longest (at least 1) input slice that matches the predicate.
304
///
305
/// The parser will return the longest slice that matches the given predicate *(a function that
306
/// takes the input and returns a bool)*.
307
///
308
/// It will return an `Err(Err::Error((_, ErrorKind::TakeWhile1)))` if the pattern wasn't met.
309
///
310
/// # Streaming Specific
311
/// *Streaming version* will return a `Err::Incomplete(Needed::new(1))` or if the pattern reaches the end of the input.
312
///
313
/// # Example
314
/// ```rust
315
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
316
/// use nom::bytes::streaming::take_while1;
317
/// use nom::character::is_alphabetic;
318
///
319
/// fn alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
320
///   take_while1(is_alphabetic)(s)
321
/// }
322
///
323
/// assert_eq!(alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));
324
/// assert_eq!(alpha(b"latin"), Err(Err::Incomplete(Needed::new(1))));
325
/// assert_eq!(alpha(b"12345"), Err(Err::Error(Error::new(&b"12345"[..], ErrorKind::TakeWhile1))));
326
/// ```
327
945k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
945k
where
329
945k
  I: Input,
330
945k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
945k
    e: ErrorKind::TakeWhile1,
334
12.6M
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<suricata::applayertemplate::template::probe::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
20.5k
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<suricata::util::is_alphanumeric_or_hyphen, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
10.6M
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<suricata::krb::detect::is_alphanumeric_or_dash, &str, nom::error::Error<&str>>::{closure#0}
Line
Count
Source
334
298k
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<suricata::sip::parser::is_version_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
113k
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
861k
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<suricata::sip::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
625k
    predicate: move |c| !cond(c),
nom::bytes::take_while1::<<suricata_htp::headers::Parser>::complete_eol_deformed::{closure#0}::{closure#1}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
87.0k
    predicate: move |c| !cond(c),
Unexecuted instantiation: nom::bytes::take_while1::<_, _, _>::{closure#0}
nom::bytes::take_while1::<suricata_htp::util::is_valid_chunked_length_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>::{closure#0}
Line
Count
Source
334
7.30k
    predicate: move |c| !cond(c),
335
945k
    error: PhantomData,
336
  }
337
945k
}
nom::bytes::take_while1::<suricata::krb::detect::is_alphanumeric_or_dash, &str, nom::error::Error<&str>>
Line
Count
Source
327
40.8k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
40.8k
where
329
40.8k
  I: Input,
330
40.8k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
40.8k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
40.8k
    error: PhantomData,
336
  }
337
40.8k
}
nom::bytes::take_while1::<suricata::util::is_alphanumeric_or_hyphen, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
15.4k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
15.4k
where
329
15.4k
  I: Input,
330
15.4k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
15.4k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
15.4k
    error: PhantomData,
336
  }
337
15.4k
}
nom::bytes::take_while1::<suricata::sip::parser::is_version_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
27.9k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
27.9k
where
329
27.9k
  I: Input,
330
27.9k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
27.9k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
27.9k
    error: PhantomData,
336
  }
337
27.9k
}
nom::bytes::take_while1::<suricata::sip::parser::is_reason_phrase, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
21.4k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
21.4k
where
329
21.4k
  I: Input,
330
21.4k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
21.4k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
21.4k
    error: PhantomData,
336
  }
337
21.4k
}
nom::bytes::take_while1::<suricata::sip::parser::is_request_uri_char, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
24.7k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
24.7k
where
329
24.7k
  I: Input,
330
24.7k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
24.7k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
24.7k
    error: PhantomData,
336
  }
337
24.7k
}
nom::bytes::take_while1::<suricata::applayertemplate::template::probe::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
11.7k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
11.7k
where
329
11.7k
  I: Input,
330
11.7k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
11.7k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
11.7k
    error: PhantomData,
336
  }
337
11.7k
}
nom::bytes::take_while1::<suricata_htp::util::is_valid_chunked_length_data::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
5.88k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
5.88k
where
329
5.88k
  I: Input,
330
5.88k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
5.88k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
5.88k
    error: PhantomData,
336
  }
337
5.88k
}
Unexecuted instantiation: nom::bytes::take_while1::<_, _, _>
nom::bytes::take_while1::<<suricata_htp::headers::Parser>::complete_eol_deformed::{closure#0}::{closure#1}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
327
797k
pub fn take_while1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
328
797k
where
329
797k
  I: Input,
330
797k
  F: Fn(<I as Input>::Item) -> bool,
331
{
332
  SplitPosition1 {
333
797k
    e: ErrorKind::TakeWhile1,
334
    predicate: move |c| !cond(c),
335
797k
    error: PhantomData,
336
  }
337
797k
}
338
339
/// Returns the longest (m <= len <= n) input slice  that matches the predicate.
340
///
341
/// The parser will return the longest slice that matches the given predicate *(a function that
342
/// takes the input and returns a bool)*.
343
///
344
/// It will return an `Err::Error((_, ErrorKind::TakeWhileMN))` if the pattern wasn't met.
345
/// # Streaming Specific
346
/// *Streaming version* will return a `Err::Incomplete(Needed::new(1))`  if the pattern reaches the end of the input or is too short.
347
///
348
/// # Example
349
/// ```rust
350
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
351
/// use nom::bytes::streaming::take_while_m_n;
352
/// use nom::character::is_alphabetic;
353
///
354
/// fn short_alpha(s: &[u8]) -> IResult<&[u8], &[u8]> {
355
///   take_while_m_n(3, 6, is_alphabetic)(s)
356
/// }
357
///
358
/// assert_eq!(short_alpha(b"latin123"), Ok((&b"123"[..], &b"latin"[..])));
359
/// assert_eq!(short_alpha(b"lengthy"), Ok((&b"y"[..], &b"length"[..])));
360
/// assert_eq!(short_alpha(b"latin"), Err(Err::Incomplete(Needed::new(1))));
361
/// assert_eq!(short_alpha(b"ed"), Err(Err::Incomplete(Needed::new(1))));
362
/// assert_eq!(short_alpha(b"12345"), Err(Err::Error(Error::new(&b"12345"[..], ErrorKind::TakeWhileMN))));
363
/// ```
364
5.73M
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
5.73M
  m: usize,
366
5.73M
  n: usize,
367
5.73M
  predicate: F,
368
5.73M
) -> impl Parser<I, Output = I, Error = Error>
369
5.73M
where
370
5.73M
  I: Input,
371
5.73M
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
5.73M
  TakeWhileMN {
374
5.73M
    m,
375
5.73M
    n,
376
5.73M
    predicate,
377
5.73M
    e: PhantomData,
378
5.73M
  }
379
5.73M
}
nom::bytes::take_while_m_n::<suricata::mqtt::parser::is_continuation_bit_set, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
5.38M
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
5.38M
  m: usize,
366
5.38M
  n: usize,
367
5.38M
  predicate: F,
368
5.38M
) -> impl Parser<I, Output = I, Error = Error>
369
5.38M
where
370
5.38M
  I: Input,
371
5.38M
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
5.38M
  TakeWhileMN {
374
5.38M
    m,
375
5.38M
    n,
376
5.38M
    predicate,
377
5.38M
    e: PhantomData,
378
5.38M
  }
379
5.38M
}
nom::bytes::take_while_m_n::<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
4
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
4
  m: usize,
366
4
  n: usize,
367
4
  predicate: F,
368
4
) -> impl Parser<I, Output = I, Error = Error>
369
4
where
370
4
  I: Input,
371
4
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
4
  TakeWhileMN {
374
4
    m,
375
4
    n,
376
4
    predicate,
377
4
    e: PhantomData,
378
4
  }
379
4
}
nom::bytes::take_while_m_n::<suricata::sdp::parser::parse_media_description::{closure#2}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
3.25k
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
3.25k
  m: usize,
366
3.25k
  n: usize,
367
3.25k
  predicate: F,
368
3.25k
) -> impl Parser<I, Output = I, Error = Error>
369
3.25k
where
370
3.25k
  I: Input,
371
3.25k
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
3.25k
  TakeWhileMN {
374
3.25k
    m,
375
3.25k
    n,
376
3.25k
    predicate,
377
3.25k
    e: PhantomData,
378
3.25k
  }
379
3.25k
}
nom::bytes::take_while_m_n::<suricata::sdp::parser::parse_media_description::{closure#4}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
3.22k
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
3.22k
  m: usize,
366
3.22k
  n: usize,
367
3.22k
  predicate: F,
368
3.22k
) -> impl Parser<I, Output = I, Error = Error>
369
3.22k
where
370
3.22k
  I: Input,
371
3.22k
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
3.22k
  TakeWhileMN {
374
3.22k
    m,
375
3.22k
    n,
376
3.22k
    predicate,
377
3.22k
    e: PhantomData,
378
3.22k
  }
379
3.22k
}
nom::bytes::take_while_m_n::<suricata::sdp::parser::parse_media_description::{closure#1}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
3.27k
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
3.27k
  m: usize,
366
3.27k
  n: usize,
367
3.27k
  predicate: F,
368
3.27k
) -> impl Parser<I, Output = I, Error = Error>
369
3.27k
where
370
3.27k
  I: Input,
371
3.27k
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
3.27k
  TakeWhileMN {
374
3.27k
    m,
375
3.27k
    n,
376
3.27k
    predicate,
377
3.27k
    e: PhantomData,
378
3.27k
  }
379
3.27k
}
nom::bytes::take_while_m_n::<suricata_htp::util::validate_hostname::{closure#1}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
234k
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
234k
  m: usize,
366
234k
  n: usize,
367
234k
  predicate: F,
368
234k
) -> impl Parser<I, Output = I, Error = Error>
369
234k
where
370
234k
  I: Input,
371
234k
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
234k
  TakeWhileMN {
374
234k
    m,
375
234k
    n,
376
234k
    predicate,
377
234k
    e: PhantomData,
378
234k
  }
379
234k
}
nom::bytes::take_while_m_n::<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
66.7k
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
66.7k
  m: usize,
366
66.7k
  n: usize,
367
66.7k
  predicate: F,
368
66.7k
) -> impl Parser<I, Output = I, Error = Error>
369
66.7k
where
370
66.7k
  I: Input,
371
66.7k
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
66.7k
  TakeWhileMN {
374
66.7k
    m,
375
66.7k
    n,
376
66.7k
    predicate,
377
66.7k
    e: PhantomData,
378
66.7k
  }
379
66.7k
}
nom::bytes::take_while_m_n::<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
364
36.6k
pub fn take_while_m_n<F, I, Error: ParseError<I>>(
365
36.6k
  m: usize,
366
36.6k
  n: usize,
367
36.6k
  predicate: F,
368
36.6k
) -> impl Parser<I, Output = I, Error = Error>
369
36.6k
where
370
36.6k
  I: Input,
371
36.6k
  F: Fn(<I as Input>::Item) -> bool,
372
{
373
36.6k
  TakeWhileMN {
374
36.6k
    m,
375
36.6k
    n,
376
36.6k
    predicate,
377
36.6k
    e: PhantomData,
378
36.6k
  }
379
36.6k
}
Unexecuted instantiation: nom::bytes::take_while_m_n::<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Unexecuted instantiation: nom::bytes::take_while_m_n::<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Unexecuted instantiation: nom::bytes::take_while_m_n::<_, _, _>
380
381
/// Parser implementation for [take_while_m_n]
382
pub struct TakeWhileMN<F, E> {
383
  m: usize,
384
  n: usize,
385
  predicate: F,
386
  e: PhantomData<E>,
387
}
388
389
impl<I, Error: ParseError<I>, F> Parser<I> for TakeWhileMN<F, Error>
390
where
391
  I: Input,
392
  F: Fn(<I as Input>::Item) -> bool,
393
{
394
  type Output = I;
395
  type Error = Error;
396
397
5.74M
  fn process<OM: OutputMode>(
398
5.74M
    &mut self,
399
5.74M
    input: I,
400
5.74M
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
5.74M
    let mut count = 0;
402
7.09M
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
7.09M
      if i == self.n {
404
        return Ok((
405
87.1k
          input.take_from(index),
406
87.1k
          OM::Output::bind(|| input.take(index)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#2}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#4}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
406
3.23k
          OM::Output::bind(|| input.take(index)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
<nom::bytes::TakeWhileMN<suricata::mqtt::parser::is_continuation_bit_set, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Line
Count
Source
406
51.8k
          OM::Output::bind(|| input.take(index)),
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
406
23.4k
          OM::Output::bind(|| input.take(index)),
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
406
8.50k
          OM::Output::bind(|| input.take(index)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::util::validate_hostname::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
407
        ));
408
7.00M
      }
409
410
7.00M
      if !(self.predicate)(item) {
411
5.49M
        if i >= self.m {
412
          return Ok((
413
5.33M
            input.take_from(index),
414
5.33M
            OM::Output::bind(|| input.take(index)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#2}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#4}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
414
14.7k
            OM::Output::bind(|| input.take(index)),
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
414
14
            OM::Output::bind(|| input.take(index)),
<nom::bytes::TakeWhileMN<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
414
4
            OM::Output::bind(|| input.take(index)),
<nom::bytes::TakeWhileMN<suricata::mqtt::parser::is_continuation_bit_set, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
414
5.32M
            OM::Output::bind(|| input.take(index)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::util::validate_hostname::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#1}
415
          ));
416
        } else {
417
157k
          return Err(Err::Error(OM::Error::bind(|| {
418
157k
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
157k
          })));
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#2}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#4}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
417
103
          return Err(Err::Error(OM::Error::bind(|| {
418
103
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
103
          })));
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
417
3
          return Err(Err::Error(OM::Error::bind(|| {
418
3
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
3
          })));
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::mqtt::parser::is_continuation_bit_set, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
417
38.7k
          return Err(Err::Error(OM::Error::bind(|| {
418
38.7k
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
38.7k
          })));
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
417
25.7k
          return Err(Err::Error(OM::Error::bind(|| {
418
25.7k
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
25.7k
          })));
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
<nom::bytes::TakeWhileMN<suricata_htp::util::validate_hostname::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#2}
Line
Count
Source
417
93.0k
          return Err(Err::Error(OM::Error::bind(|| {
418
93.0k
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
93.0k
          })));
Unexecuted instantiation: <nom::bytes::TakeWhileMN<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#2}
420
        }
421
1.50M
      }
422
1.50M
      count += 1;
423
    }
424
425
161k
    let input_len = input.input_len();
426
161k
    if OM::Incomplete::is_streaming() {
427
13.6k
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
13.6k
        1
431
      };
432
13.6k
      Err(Err::Incomplete(Needed::new(needed)))
433
148k
    } else if count >= self.m {
434
      Ok((
435
143k
        input.take_from(input_len),
436
143k
        OM::Output::bind(|| input.take(input_len)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#2}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#4}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Line
Count
Source
436
65
        OM::Output::bind(|| input.take(input_len)),
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Line
Count
Source
436
10
        OM::Output::bind(|| input.take(input_len)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::mqtt::parser::is_continuation_bit_set, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#3}
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Line
Count
Source
436
1.15k
        OM::Output::bind(|| input.take(input_len)),
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Line
Count
Source
436
1.43k
        OM::Output::bind(|| input.take(input_len)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
<nom::bytes::TakeWhileMN<suricata_htp::util::validate_hostname::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#3}
Line
Count
Source
436
141k
        OM::Output::bind(|| input.take(input_len)),
Unexecuted instantiation: <nom::bytes::TakeWhileMN<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#3}
437
      ))
438
    } else {
439
4.34k
      Err(Err::Error(OM::Error::bind(|| {
440
4.34k
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
4.34k
      })))
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#2}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#4}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Line
Count
Source
439
3
      Err(Err::Error(OM::Error::bind(|| {
440
3
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
3
      })))
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Line
Count
Source
439
8
      Err(Err::Error(OM::Error::bind(|| {
440
8
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
8
      })))
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::mqtt::parser::is_continuation_bit_set, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#4}
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Line
Count
Source
439
3.32k
      Err(Err::Error(OM::Error::bind(|| {
440
3.32k
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
3.32k
      })))
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Line
Count
Source
439
1.00k
      Err(Err::Error(OM::Error::bind(|| {
440
1.00k
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
1.00k
      })))
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::util::validate_hostname::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#4}
Unexecuted instantiation: <nom::bytes::TakeWhileMN<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#4}
442
    }
443
5.74M
  }
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#2}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#4}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
397
14.9k
  fn process<OM: OutputMode>(
398
14.9k
    &mut self,
399
14.9k
    input: I,
400
14.9k
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
14.9k
    let mut count = 0;
402
41.9k
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
41.9k
      if i == self.n {
404
        return Ok((
405
0
          input.take_from(index),
406
0
          OM::Output::bind(|| input.take(index)),
407
        ));
408
41.9k
      }
409
410
41.9k
      if !(self.predicate)(item) {
411
14.8k
        if i >= self.m {
412
          return Ok((
413
14.7k
            input.take_from(index),
414
14.7k
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
103
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
27.1k
      }
422
27.1k
      count += 1;
423
    }
424
425
68
    let input_len = input.input_len();
426
68
    if OM::Incomplete::is_streaming() {
427
0
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
0
        1
431
      };
432
0
      Err(Err::Incomplete(Needed::new(needed)))
433
68
    } else if count >= self.m {
434
      Ok((
435
65
        input.take_from(input_len),
436
65
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
3
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
14.9k
  }
<nom::bytes::TakeWhileMN<suricata::sdp::parser::parse_media_description::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
397
3.27k
  fn process<OM: OutputMode>(
398
3.27k
    &mut self,
399
3.27k
    input: I,
400
3.27k
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
3.27k
    let mut count = 0;
402
19.5k
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
19.5k
      if i == self.n {
404
        return Ok((
405
3.23k
          input.take_from(index),
406
3.23k
          OM::Output::bind(|| input.take(index)),
407
        ));
408
16.2k
      }
409
410
16.2k
      if !(self.predicate)(item) {
411
17
        if i >= self.m {
412
          return Ok((
413
14
            input.take_from(index),
414
14
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
3
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
16.2k
      }
422
16.2k
      count += 1;
423
    }
424
425
18
    let input_len = input.input_len();
426
18
    if OM::Incomplete::is_streaming() {
427
0
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
0
        1
431
      };
432
0
      Err(Err::Incomplete(Needed::new(needed)))
433
18
    } else if count >= self.m {
434
      Ok((
435
10
        input.take_from(input_len),
436
10
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
8
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
3.27k
  }
<nom::bytes::TakeWhileMN<suricata::pop3::pop3::parse_response_header_with_octets::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
397
4
  fn process<OM: OutputMode>(
398
4
    &mut self,
399
4
    input: I,
400
4
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
4
    let mut count = 0;
402
20
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
20
      if i == self.n {
404
        return Ok((
405
0
          input.take_from(index),
406
0
          OM::Output::bind(|| input.take(index)),
407
        ));
408
20
      }
409
410
20
      if !(self.predicate)(item) {
411
4
        if i >= self.m {
412
          return Ok((
413
4
            input.take_from(index),
414
4
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
0
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
16
      }
422
16
      count += 1;
423
    }
424
425
0
    let input_len = input.input_len();
426
0
    if OM::Incomplete::is_streaming() {
427
0
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
0
        1
431
      };
432
0
      Err(Err::Incomplete(Needed::new(needed)))
433
0
    } else if count >= self.m {
434
      Ok((
435
0
        input.take_from(input_len),
436
0
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
0
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
4
  }
<nom::bytes::TakeWhileMN<suricata::mqtt::parser::is_continuation_bit_set, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
397
5.38M
  fn process<OM: OutputMode>(
398
5.38M
    &mut self,
399
5.38M
    input: I,
400
5.38M
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
5.38M
    let mut count = 0;
402
5.96M
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
5.96M
      if i == self.n {
404
        return Ok((
405
51.8k
          input.take_from(index),
406
51.8k
          OM::Output::bind(|| input.take(index)),
407
        ));
408
5.91M
      }
409
410
5.91M
      if !(self.predicate)(item) {
411
5.32M
        if i >= self.m {
412
          return Ok((
413
5.32M
            input.take_from(index),
414
5.32M
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
0
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
591k
      }
422
591k
      count += 1;
423
    }
424
425
13.6k
    let input_len = input.input_len();
426
13.6k
    if OM::Incomplete::is_streaming() {
427
13.6k
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
13.6k
        1
431
      };
432
13.6k
      Err(Err::Incomplete(Needed::new(needed)))
433
0
    } else if count >= self.m {
434
      Ok((
435
0
        input.take_from(input_len),
436
0
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
0
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
5.38M
  }
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
397
66.7k
  fn process<OM: OutputMode>(
398
66.7k
    &mut self,
399
66.7k
    input: I,
400
66.7k
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
66.7k
    let mut count = 0;
402
125k
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
125k
      if i == self.n {
404
        return Ok((
405
23.4k
          input.take_from(index),
406
23.4k
          OM::Output::bind(|| input.take(index)),
407
        ));
408
102k
      }
409
410
102k
      if !(self.predicate)(item) {
411
38.7k
        if i >= self.m {
412
          return Ok((
413
0
            input.take_from(index),
414
0
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
38.7k
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
63.5k
      }
422
63.5k
      count += 1;
423
    }
424
425
4.48k
    let input_len = input.input_len();
426
4.48k
    if OM::Incomplete::is_streaming() {
427
0
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
0
        1
431
      };
432
0
      Err(Err::Incomplete(Needed::new(needed)))
433
4.48k
    } else if count >= self.m {
434
      Ok((
435
1.15k
        input.take_from(input_len),
436
1.15k
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
3.32k
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
66.7k
  }
<nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_hex::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
397
36.6k
  fn process<OM: OutputMode>(
398
36.6k
    &mut self,
399
36.6k
    input: I,
400
36.6k
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
36.6k
    let mut count = 0;
402
67.7k
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
67.7k
      if i == self.n {
404
        return Ok((
405
8.50k
          input.take_from(index),
406
8.50k
          OM::Output::bind(|| input.take(index)),
407
        ));
408
59.2k
      }
409
410
59.2k
      if !(self.predicate)(item) {
411
25.7k
        if i >= self.m {
412
          return Ok((
413
0
            input.take_from(index),
414
0
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
25.7k
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
33.4k
      }
422
33.4k
      count += 1;
423
    }
424
425
2.43k
    let input_len = input.input_len();
426
2.43k
    if OM::Incomplete::is_streaming() {
427
0
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
0
        1
431
      };
432
0
      Err(Err::Incomplete(Needed::new(needed)))
433
2.43k
    } else if count >= self.m {
434
      Ok((
435
1.43k
        input.take_from(input_len),
436
1.43k
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
1.00k
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
36.6k
  }
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Unexecuted instantiation: <nom::bytes::TakeWhileMN<suricata_htp::urlencoded::path_decode_valid_u_encoding::{closure#0}::{closure#0}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
<nom::bytes::TakeWhileMN<suricata_htp::util::validate_hostname::{closure#1}, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
397
234k
  fn process<OM: OutputMode>(
398
234k
    &mut self,
399
234k
    input: I,
400
234k
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
401
234k
    let mut count = 0;
402
869k
    for (i, (index, item)) in input.iter_indices().enumerate() {
403
869k
      if i == self.n {
404
        return Ok((
405
0
          input.take_from(index),
406
0
          OM::Output::bind(|| input.take(index)),
407
        ));
408
869k
      }
409
410
869k
      if !(self.predicate)(item) {
411
93.0k
        if i >= self.m {
412
          return Ok((
413
0
            input.take_from(index),
414
0
            OM::Output::bind(|| input.take(index)),
415
          ));
416
        } else {
417
93.0k
          return Err(Err::Error(OM::Error::bind(|| {
418
            Error::from_error_kind(input, ErrorKind::TakeWhileMN)
419
          })));
420
        }
421
776k
      }
422
776k
      count += 1;
423
    }
424
425
141k
    let input_len = input.input_len();
426
141k
    if OM::Incomplete::is_streaming() {
427
0
      let needed = if self.m > input_len {
428
0
        self.m - input_len
429
      } else {
430
0
        1
431
      };
432
0
      Err(Err::Incomplete(Needed::new(needed)))
433
141k
    } else if count >= self.m {
434
      Ok((
435
141k
        input.take_from(input_len),
436
141k
        OM::Output::bind(|| input.take(input_len)),
437
      ))
438
    } else {
439
0
      Err(Err::Error(OM::Error::bind(|| {
440
        Error::from_error_kind(input, ErrorKind::TakeWhileMN)
441
      })))
442
    }
443
234k
  }
Unexecuted instantiation: <nom::bytes::TakeWhileMN<_, _> as nom::internal::Parser<_>>::process::<_>
444
}
445
446
/// Returns the longest input slice (if any) till a predicate is met.
447
///
448
/// The parser will return the longest slice till the given predicate *(a function that
449
/// takes the input and returns a bool)*.
450
/// # Example
451
/// ```rust
452
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
453
/// use nom::bytes::complete::take_till;
454
///
455
/// fn till_colon(s: &str) -> IResult<&str, &str> {
456
///   take_till(|c| c == ':')(s)
457
/// }
458
///
459
/// assert_eq!(till_colon("latin:123"), Ok((":123", "latin")));
460
/// assert_eq!(till_colon(":empty matched"), Ok((":empty matched", ""))); //allowed
461
/// assert_eq!(till_colon("12345"), Ok(("", "12345")));
462
/// assert_eq!(till_colon(""), Ok(("", "")));
463
/// ```
464
#[allow(clippy::redundant_closure)]
465
31.1M
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
31.1M
where
467
31.1M
  I: Input,
468
31.1M
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
31.1M
  SplitPosition {
471
31.1M
    predicate: cond,
472
31.1M
    error: PhantomData,
473
31.1M
  }
474
31.1M
}
nom::bytes::take_till::<suricata::mime::mime::mime_parse_skip_line::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
75.1k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
75.1k
where
467
75.1k
  I: Input,
468
75.1k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
75.1k
  SplitPosition {
471
75.1k
    predicate: cond,
472
75.1k
    error: PhantomData,
473
75.1k
  }
474
75.1k
}
nom::bytes::take_till::<suricata::mime::mime::mime_parse_header_line::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
6.39M
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
6.39M
where
467
6.39M
  I: Input,
468
6.39M
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
6.39M
  SplitPosition {
471
6.39M
    predicate: cond,
472
6.39M
    error: PhantomData,
473
6.39M
  }
474
6.39M
}
nom::bytes::take_till::<suricata::mime::mime::mime_parse_boundary_regular::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
12.2k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
12.2k
where
467
12.2k
  I: Input,
468
12.2k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
12.2k
  SplitPosition {
471
12.2k
    predicate: cond,
472
12.2k
    error: PhantomData,
473
12.2k
  }
474
12.2k
}
nom::bytes::take_till::<suricata::mime::mime::mime_skip_value_until_semicolon::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
2.38M
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
2.38M
where
467
2.38M
  I: Input,
468
2.38M
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
2.38M
  SplitPosition {
471
2.38M
    predicate: cond,
472
2.38M
    error: PhantomData,
473
2.38M
  }
474
2.38M
}
nom::bytes::take_till::<suricata::detect::requires::parse_key_value::{closure#1}, &str, nom::error::Error<&str>>
Line
Count
Source
465
46.5k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
46.5k
where
467
46.5k
  I: Input,
468
46.5k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
46.5k
  SplitPosition {
471
46.5k
    predicate: cond,
472
46.5k
    error: PhantomData,
473
46.5k
  }
474
46.5k
}
nom::bytes::take_till::<suricata::detect::requires::parse_next_version_part::{closure#0}, &str, nom::error::Error<&str>>
Line
Count
Source
465
123k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
123k
where
467
123k
  I: Input,
468
123k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
123k
  SplitPosition {
471
123k
    predicate: cond,
472
123k
    error: PhantomData,
473
123k
  }
474
123k
}
nom::bytes::take_till::<suricata::sdp::parser::is_line_ending, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
23.4k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
23.4k
where
467
23.4k
  I: Input,
468
23.4k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
23.4k
  SplitPosition {
471
23.4k
    predicate: cond,
472
23.4k
    error: PhantomData,
473
23.4k
  }
474
23.4k
}
Unexecuted instantiation: nom::bytes::take_till::<suricata::detect::uint::detect_parse_unquote_uint<u16>::{closure#1}, &str, nom::error::Error<&str>>
nom::bytes::take_till::<suricata_htp::util::ascii_digits::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
276k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
276k
where
467
276k
  I: Input,
468
276k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
276k
  SplitPosition {
471
276k
    predicate: cond,
472
276k
    error: PhantomData,
473
276k
  }
474
276k
}
nom::bytes::take_till::<suricata_htp::util::take_till_lf::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
9.88M
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
9.88M
where
467
9.88M
  I: Input,
468
9.88M
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
9.88M
  SplitPosition {
471
9.88M
    predicate: cond,
472
9.88M
    error: PhantomData,
473
9.88M
  }
474
9.88M
}
nom::bytes::take_till::<suricata_htp::util::take_till_eol::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
1.83M
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
1.83M
where
467
1.83M
  I: Input,
468
1.83M
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
1.83M
  SplitPosition {
471
1.83M
    predicate: cond,
472
1.83M
    error: PhantomData,
473
1.83M
  }
474
1.83M
}
nom::bytes::take_till::<suricata_htp::util::take_till_lf_null::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
141
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
141
where
467
141
  I: Input,
468
141
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
141
  SplitPosition {
471
141
    predicate: cond,
472
141
    error: PhantomData,
473
141
  }
474
141
}
nom::bytes::take_till::<suricata_htp::parsers::content_type::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
37.0k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
37.0k
where
467
37.0k
  I: Input,
468
37.0k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
37.0k
  SplitPosition {
471
37.0k
    predicate: cond,
472
37.0k
    error: PhantomData,
473
37.0k
  }
474
37.0k
}
nom::bytes::take_till::<suricata_htp::parsers::query::{closure#0}::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
373k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
373k
where
467
373k
  I: Input,
468
373k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
373k
  SplitPosition {
471
373k
    predicate: cond,
472
373k
    error: PhantomData,
473
373k
  }
474
373k
}
Unexecuted instantiation: nom::bytes::take_till::<_, _, _>
nom::bytes::take_till::<<suricata_htp::connection_parser::ConnectionParser>::response_body_determine::{closure#2}, &[u8], (&[u8], nom::error::ErrorKind)>
Line
Count
Source
465
25.4k
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
25.4k
where
467
25.4k
  I: Input,
468
25.4k
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
25.4k
  SplitPosition {
471
25.4k
    predicate: cond,
472
25.4k
    error: PhantomData,
473
25.4k
  }
474
25.4k
}
nom::bytes::take_till::<<suricata_htp::headers::Parser>::is_eol::{closure#0}, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
465
9.64M
pub fn take_till<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
466
9.64M
where
467
9.64M
  I: Input,
468
9.64M
  F: Fn(<I as Input>::Item) -> bool,
469
{
470
9.64M
  SplitPosition {
471
9.64M
    predicate: cond,
472
9.64M
    error: PhantomData,
473
9.64M
  }
474
9.64M
}
475
476
/// Returns the longest (at least 1) input slice till a predicate is met.
477
///
478
/// The parser will return the longest slice till the given predicate *(a function that
479
/// takes the input and returns a bool)*.
480
///
481
/// # Streaming Specific
482
/// *Streaming version* will return a `Err::Incomplete(Needed::new(1))` if the match reaches the
483
/// end of input or if there was not match.
484
/// # Example
485
/// ```rust
486
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
487
/// use nom::bytes::streaming::take_till1;
488
///
489
/// fn till_colon(s: &str) -> IResult<&str, &str> {
490
///   take_till1(|c| c == ':')(s)
491
/// }
492
///
493
/// assert_eq!(till_colon("latin:123"), Ok((":123", "latin")));
494
/// assert_eq!(till_colon(":empty matched"), Err(Err::Error(Error::new(":empty matched", ErrorKind::TakeTill1))));
495
/// assert_eq!(till_colon("12345"), Err(Err::Incomplete(Needed::new(1))));
496
/// assert_eq!(till_colon(""), Err(Err::Incomplete(Needed::new(1))));
497
/// ```
498
#[allow(clippy::redundant_closure)]
499
0
pub fn take_till1<F, I, Error: ParseError<I>>(cond: F) -> impl Parser<I, Output = I, Error = Error>
500
0
where
501
0
  I: Input,
502
0
  F: Fn(<I as Input>::Item) -> bool,
503
{
504
0
  SplitPosition1 {
505
0
    e: ErrorKind::TakeTill1,
506
0
    predicate: cond,
507
0
    error: PhantomData,
508
0
  }
509
0
}
510
511
/// Returns an input slice containing the first N input elements (Input[..N]).
512
///
513
/// # Streaming Specific
514
/// *Streaming version* if the input has less than N elements, `take` will
515
/// return a `Err::Incomplete(Needed::new(M))` where M is the number of
516
/// additional bytes the parser would need to succeed.
517
/// It is well defined for `&[u8]` as the number of elements is the byte size,
518
/// but for types like `&str`, we cannot know how many bytes correspond for
519
/// the next few chars, so the result will be `Err::Incomplete(Needed::Unknown)`
520
///
521
/// # Example
522
/// ```rust
523
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
524
/// use nom::bytes::streaming::take;
525
///
526
/// fn take6(s: &str) -> IResult<&str, &str> {
527
///   take(6usize)(s)
528
/// }
529
///
530
/// assert_eq!(take6("1234567"), Ok(("7", "123456")));
531
/// assert_eq!(take6("things"), Ok(("", "things")));
532
/// assert_eq!(take6("short"), Err(Err::Incomplete(Needed::Unknown)));
533
/// ```
534
18.3M
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
18.3M
where
536
18.3M
  I: Input,
537
18.3M
  C: ToUsize,
538
{
539
18.3M
  Take {
540
18.3M
    length: count.to_usize(),
541
18.3M
    e: PhantomData,
542
18.3M
  }
543
18.3M
}
nom::bytes::take::<u8, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
534
5.14M
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
5.14M
where
536
5.14M
  I: Input,
537
5.14M
  C: ToUsize,
538
{
539
5.14M
  Take {
540
5.14M
    length: count.to_usize(),
541
5.14M
    e: PhantomData,
542
5.14M
  }
543
5.14M
}
nom::bytes::take::<u8, &[u8], suricata::rdp::error::RdpError>
Line
Count
Source
534
252
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
252
where
536
252
  I: Input,
537
252
  C: ToUsize,
538
{
539
252
  Take {
540
252
    length: count.to_usize(),
541
252
    e: PhantomData,
542
252
  }
543
252
}
nom::bytes::take::<u8, &[u8], suricata::quic::error::QuicError>
Line
Count
Source
534
50.4k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
50.4k
where
536
50.4k
  I: Input,
537
50.4k
  C: ToUsize,
538
{
539
50.4k
  Take {
540
50.4k
    length: count.to_usize(),
541
50.4k
    e: PhantomData,
542
50.4k
  }
543
50.4k
}
nom::bytes::take::<usize, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
534
9.68M
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
9.68M
where
536
9.68M
  I: Input,
537
9.68M
  C: ToUsize,
538
{
539
9.68M
  Take {
540
9.68M
    length: count.to_usize(),
541
9.68M
    e: PhantomData,
542
9.68M
  }
543
9.68M
}
nom::bytes::take::<usize, &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>
Line
Count
Source
534
149k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
149k
where
536
149k
  I: Input,
537
149k
  C: ToUsize,
538
{
539
149k
  Take {
540
149k
    length: count.to_usize(),
541
149k
    e: PhantomData,
542
149k
  }
543
149k
}
nom::bytes::take::<usize, &[u8], suricata::smb::error::SmbError>
Line
Count
Source
534
459k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
459k
where
536
459k
  I: Input,
537
459k
  C: ToUsize,
538
{
539
459k
  Take {
540
459k
    length: count.to_usize(),
541
459k
    e: PhantomData,
542
459k
  }
543
459k
}
nom::bytes::take::<usize, &[u8], suricata::quic::error::QuicError>
Line
Count
Source
534
192k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
192k
where
536
192k
  I: Input,
537
192k
  C: ToUsize,
538
{
539
192k
  Take {
540
192k
    length: count.to_usize(),
541
192k
    e: PhantomData,
542
192k
  }
543
192k
}
nom::bytes::take::<usize, &str, nom::error::Error<&str>>
Line
Count
Source
534
51.4k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
51.4k
where
536
51.4k
  I: Input,
537
51.4k
  C: ToUsize,
538
{
539
51.4k
  Take {
540
51.4k
    length: count.to_usize(),
541
51.4k
    e: PhantomData,
542
51.4k
  }
543
51.4k
}
nom::bytes::take::<u32, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
534
840k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
840k
where
536
840k
  I: Input,
537
840k
  C: ToUsize,
538
{
539
840k
  Take {
540
840k
    length: count.to_usize(),
541
840k
    e: PhantomData,
542
840k
  }
543
840k
}
nom::bytes::take::<u32, &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>
Line
Count
Source
534
667k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
667k
where
536
667k
  I: Input,
537
667k
  C: ToUsize,
538
{
539
667k
  Take {
540
667k
    length: count.to_usize(),
541
667k
    e: PhantomData,
542
667k
  }
543
667k
}
nom::bytes::take::<u32, &[u8], suricata::rdp::error::RdpError>
Line
Count
Source
534
421
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
421
where
536
421
  I: Input,
537
421
  C: ToUsize,
538
{
539
421
  Take {
540
421
    length: count.to_usize(),
541
421
    e: PhantomData,
542
421
  }
543
421
}
nom::bytes::take::<u32, &[u8], suricata::quic::error::QuicError>
Line
Count
Source
534
73.3k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
73.3k
where
536
73.3k
  I: Input,
537
73.3k
  C: ToUsize,
538
{
539
73.3k
  Take {
540
73.3k
    length: count.to_usize(),
541
73.3k
    e: PhantomData,
542
73.3k
  }
543
73.3k
}
nom::bytes::take::<u16, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
534
954k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
954k
where
536
954k
  I: Input,
537
954k
  C: ToUsize,
538
{
539
954k
  Take {
540
954k
    length: count.to_usize(),
541
954k
    e: PhantomData,
542
954k
  }
543
954k
}
nom::bytes::take::<u16, &[u8], suricata::rdp::error::RdpError>
Line
Count
Source
534
9.37k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
9.37k
where
536
9.37k
  I: Input,
537
9.37k
  C: ToUsize,
538
{
539
9.37k
  Take {
540
9.37k
    length: count.to_usize(),
541
9.37k
    e: PhantomData,
542
9.37k
  }
543
9.37k
}
nom::bytes::take::<u16, &[u8], suricata::smb::error::SmbError>
Line
Count
Source
534
60.6k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
60.6k
where
536
60.6k
  I: Input,
537
60.6k
  C: ToUsize,
538
{
539
60.6k
  Take {
540
60.6k
    length: count.to_usize(),
541
60.6k
    e: PhantomData,
542
60.6k
  }
543
60.6k
}
nom::bytes::take::<usize, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
534
26.7k
pub fn take<C, I, Error: ParseError<I>>(count: C) -> impl Parser<I, Output = I, Error = Error>
535
26.7k
where
536
26.7k
  I: Input,
537
26.7k
  C: ToUsize,
538
{
539
26.7k
  Take {
540
26.7k
    length: count.to_usize(),
541
26.7k
    e: PhantomData,
542
26.7k
  }
543
26.7k
}
Unexecuted instantiation: nom::bytes::take::<_, _, _>
544
545
/// Parser implementation for [take]
546
pub struct Take<E> {
547
  length: usize,
548
  e: PhantomData<E>,
549
}
550
551
impl<I, Error: ParseError<I>> Parser<I> for Take<Error>
552
where
553
  I: Input,
554
{
555
  type Output = I;
556
  type Error = Error;
557
558
17.6M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
17.6M
    match i.slice_index(self.length) {
560
2.55M
      Err(needed) => {
561
2.55M
        if OM::Incomplete::is_streaming() {
562
2.53M
          Err(Err::Incomplete(needed))
563
        } else {
564
21.5k
          Err(Err::Error(OM::Error::bind(|| {
565
21.5k
            let e: ErrorKind = ErrorKind::Eof;
566
21.5k
            Error::from_error_kind(i, e)
567
21.5k
          })))
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
564
16.4k
          Err(Err::Error(OM::Error::bind(|| {
565
16.4k
            let e: ErrorKind = ErrorKind::Eof;
566
16.4k
            Error::from_error_kind(i, e)
567
16.4k
          })))
Unexecuted instantiation: <nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
<nom::bytes::Take<nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
564
1
          Err(Err::Error(OM::Error::bind(|| {
565
1
            let e: ErrorKind = ErrorKind::Eof;
566
1
            Error::from_error_kind(i, e)
567
1
          })))
Unexecuted instantiation: <nom::bytes::Take<suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::Take<suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::Take<suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
<nom::bytes::Take<suricata::quic::error::QuicError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
564
3.06k
          Err(Err::Error(OM::Error::bind(|| {
565
3.06k
            let e: ErrorKind = ErrorKind::Eof;
566
3.06k
            Error::from_error_kind(i, e)
567
3.06k
          })))
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
564
2.05k
          Err(Err::Error(OM::Error::bind(|| {
565
2.05k
            let e: ErrorKind = ErrorKind::Eof;
566
2.05k
            Error::from_error_kind(i, e)
567
2.05k
          })))
Unexecuted instantiation: <nom::bytes::Take<_> as nom::internal::Parser<_>>::process::<_>::{closure#0}
568
        }
569
      }
570
15.1M
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
570
588k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
570
13.2M
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
570
51.4k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
570
355k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
570
3.85k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
570
490k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<suricata::quic::error::QuicError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
570
313k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
570
24.7k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
Unexecuted instantiation: <nom::bytes::Take<_> as nom::internal::Parser<_>>::process::<_>::{closure#1}
571
    }
572
17.6M
  }
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
558
605k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
605k
    match i.slice_index(self.length) {
560
16.4k
      Err(needed) => {
561
16.4k
        if OM::Incomplete::is_streaming() {
562
0
          Err(Err::Incomplete(needed))
563
        } else {
564
16.4k
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
588k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
605k
  }
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
558
15.3M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
15.3M
    match i.slice_index(self.length) {
560
2.05M
      Err(needed) => {
561
2.05M
        if OM::Incomplete::is_streaming() {
562
2.05M
          Err(Err::Incomplete(needed))
563
        } else {
564
0
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
13.2M
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
15.3M
  }
<nom::bytes::Take<nom::error::Error<&str>> as nom::internal::Parser<&str>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
558
51.4k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
51.4k
    match i.slice_index(self.length) {
560
1
      Err(needed) => {
561
1
        if OM::Incomplete::is_streaming() {
562
0
          Err(Err::Incomplete(needed))
563
        } else {
564
1
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
51.4k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
51.4k
  }
<nom::bytes::Take<suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
558
815k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
815k
    match i.slice_index(self.length) {
560
459k
      Err(needed) => {
561
459k
        if OM::Incomplete::is_streaming() {
562
459k
          Err(Err::Incomplete(needed))
563
        } else {
564
0
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
355k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
815k
  }
<nom::bytes::Take<suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
558
10.0k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
10.0k
    match i.slice_index(self.length) {
560
6.19k
      Err(needed) => {
561
6.19k
        if OM::Incomplete::is_streaming() {
562
6.19k
          Err(Err::Incomplete(needed))
563
        } else {
564
0
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
3.85k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
10.0k
  }
<nom::bytes::Take<suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
558
508k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
508k
    match i.slice_index(self.length) {
560
18.0k
      Err(needed) => {
561
18.0k
        if OM::Incomplete::is_streaming() {
562
18.0k
          Err(Err::Incomplete(needed))
563
        } else {
564
0
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
490k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
508k
  }
<nom::bytes::Take<suricata::quic::error::QuicError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
558
316k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
316k
    match i.slice_index(self.length) {
560
3.06k
      Err(needed) => {
561
3.06k
        if OM::Incomplete::is_streaming() {
562
0
          Err(Err::Incomplete(needed))
563
        } else {
564
3.06k
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
313k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
316k
  }
<nom::bytes::Take<nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
558
26.7k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
559
26.7k
    match i.slice_index(self.length) {
560
2.05k
      Err(needed) => {
561
2.05k
        if OM::Incomplete::is_streaming() {
562
0
          Err(Err::Incomplete(needed))
563
        } else {
564
2.05k
          Err(Err::Error(OM::Error::bind(|| {
565
            let e: ErrorKind = ErrorKind::Eof;
566
            Error::from_error_kind(i, e)
567
          })))
568
        }
569
      }
570
24.7k
      Ok(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
571
    }
572
26.7k
  }
Unexecuted instantiation: <nom::bytes::Take<_> as nom::internal::Parser<_>>::process::<_>
573
}
574
575
/// Returns the input slice up to the first occurrence of the pattern.
576
///
577
/// It doesn't consume the pattern.
578
///
579
/// # Streaming Specific
580
/// *Streaming version* will return a `Err::Incomplete(Needed::new(N))` if the input doesn't
581
/// contain the pattern or if the input is smaller than the pattern.
582
/// # Example
583
/// ```rust
584
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
585
/// use nom::bytes::streaming::take_until;
586
///
587
/// fn until_eof(s: &str) -> IResult<&str, &str> {
588
///   take_until("eof")(s)
589
/// }
590
///
591
/// assert_eq!(until_eof("hello, worldeof"), Ok(("eof", "hello, world")));
592
/// assert_eq!(until_eof("hello, world"), Err(Err::Incomplete(Needed::Unknown)));
593
/// assert_eq!(until_eof("hello, worldeo"), Err(Err::Incomplete(Needed::Unknown)));
594
/// assert_eq!(until_eof("1eof2eof"), Ok(("eof2eof", "1")));
595
/// ```
596
3.59M
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
3.59M
where
598
3.59M
  I: Input + FindSubstring<T>,
599
3.59M
  T: Clone,
600
{
601
3.59M
  TakeUntil {
602
3.59M
    tag,
603
3.59M
    e: PhantomData,
604
3.59M
  }
605
3.59M
}
nom::bytes::take_until::<&[u8], &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>
Line
Count
Source
596
979k
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
979k
where
598
979k
  I: Input + FindSubstring<T>,
599
979k
  T: Clone,
600
{
601
979k
  TakeUntil {
602
979k
    tag,
603
979k
    e: PhantomData,
604
979k
  }
605
979k
}
nom::bytes::take_until::<&[u8], &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
596
1.36M
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
1.36M
where
598
1.36M
  I: Input + FindSubstring<T>,
599
1.36M
  T: Clone,
600
{
601
1.36M
  TakeUntil {
602
1.36M
    tag,
603
1.36M
    e: PhantomData,
604
1.36M
  }
605
1.36M
}
nom::bytes::take_until::<&[u8], &[u8], suricata::rdp::error::RdpError>
Line
Count
Source
596
604
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
604
where
598
604
  I: Input + FindSubstring<T>,
599
604
  T: Clone,
600
{
601
604
  TakeUntil {
602
604
    tag,
603
604
    e: PhantomData,
604
604
  }
605
604
}
nom::bytes::take_until::<&[u8], &[u8], suricata::smb::error::SmbError>
Line
Count
Source
596
38.1k
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
38.1k
where
598
38.1k
  I: Input + FindSubstring<T>,
599
38.1k
  T: Clone,
600
{
601
38.1k
  TakeUntil {
602
38.1k
    tag,
603
38.1k
    e: PhantomData,
604
38.1k
  }
605
38.1k
}
nom::bytes::take_until::<&str, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
596
528k
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
528k
where
598
528k
  I: Input + FindSubstring<T>,
599
528k
  T: Clone,
600
{
601
528k
  TakeUntil {
602
528k
    tag,
603
528k
    e: PhantomData,
604
528k
  }
605
528k
}
nom::bytes::take_until::<&str, &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
596
657k
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
657k
where
598
657k
  I: Input + FindSubstring<T>,
599
657k
  T: Clone,
600
{
601
657k
  TakeUntil {
602
657k
    tag,
603
657k
    e: PhantomData,
604
657k
  }
605
657k
}
Unexecuted instantiation: nom::bytes::take_until::<_, _, _>
nom::bytes::take_until::<&[u8], &[u8], nom::error::Error<&[u8]>>
Line
Count
Source
596
20.5k
pub fn take_until<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
597
20.5k
where
598
20.5k
  I: Input + FindSubstring<T>,
599
20.5k
  T: Clone,
600
{
601
20.5k
  TakeUntil {
602
20.5k
    tag,
603
20.5k
    e: PhantomData,
604
20.5k
  }
605
20.5k
}
606
607
/// Parser implementation for [take_until]
608
pub struct TakeUntil<T, E> {
609
  tag: T,
610
  e: PhantomData<E>,
611
}
612
613
impl<I, T, Error: ParseError<I>> Parser<I> for TakeUntil<T, Error>
614
where
615
  I: Input + FindSubstring<T>,
616
  T: Clone,
617
{
618
  type Output = I;
619
  type Error = Error;
620
621
3.46M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
3.46M
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
730k
        if OM::Incomplete::is_streaming() {
625
264k
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
466k
          Err(Err::Error(OM::Error::bind(|| {
628
466k
            let e: ErrorKind = ErrorKind::TakeUntil;
629
466k
            Error::from_error_kind(i, e)
630
466k
          })))
Unexecuted instantiation: <nom::bytes::TakeUntil<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeUntil<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeUntil<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeUntil<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
627
61.4k
          Err(Err::Error(OM::Error::bind(|| {
628
61.4k
            let e: ErrorKind = ErrorKind::TakeUntil;
629
61.4k
            Error::from_error_kind(i, e)
630
61.4k
          })))
Unexecuted instantiation: <nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeUntil<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#0}
Line
Count
Source
627
404k
          Err(Err::Error(OM::Error::bind(|| {
628
404k
            let e: ErrorKind = ErrorKind::TakeUntil;
629
404k
            Error::from_error_kind(i, e)
630
404k
          })))
Unexecuted instantiation: <nom::bytes::TakeUntil<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
631
        }
632
      }
633
2.73M
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
633
1.23M
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
633
959k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
633
582
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
633
30.0k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
633
141k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
633
227k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
633
5.71k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>::{closure#1}
Line
Count
Source
633
134k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
Unexecuted instantiation: <nom::bytes::TakeUntil<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#1}
634
    }
635
3.46M
  }
<nom::bytes::TakeUntil<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
621
1.36M
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
1.36M
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
129k
        if OM::Incomplete::is_streaming() {
625
129k
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
0
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
1.23M
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
1.36M
  }
<nom::bytes::TakeUntil<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
621
974k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
974k
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
14.5k
        if OM::Incomplete::is_streaming() {
625
14.5k
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
0
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
959k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
974k
  }
<nom::bytes::TakeUntil<&[u8], suricata::rdp::error::RdpError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
621
604
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
604
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
22
        if OM::Incomplete::is_streaming() {
625
22
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
0
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
582
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
604
  }
<nom::bytes::TakeUntil<&[u8], suricata::smb::error::SmbError> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
621
38.1k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
38.1k
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
8.11k
        if OM::Incomplete::is_streaming() {
625
8.11k
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
0
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
30.0k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
38.1k
  }
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
621
202k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
202k
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
61.4k
        if OM::Incomplete::is_streaming() {
625
0
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
61.4k
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
141k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
202k
  }
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
621
325k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
325k
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
97.3k
        if OM::Incomplete::is_streaming() {
625
97.3k
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
0
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
227k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
325k
  }
<nom::bytes::TakeUntil<&[u8], nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
621
20.5k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
20.5k
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
14.7k
        if OM::Incomplete::is_streaming() {
625
14.7k
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
0
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
5.71k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
20.5k
  }
<nom::bytes::TakeUntil<&str, nom::error::Error<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>>
Line
Count
Source
621
539k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
622
539k
    match i.find_substring(self.tag.clone()) {
623
      None => {
624
404k
        if OM::Incomplete::is_streaming() {
625
0
          Err(Err::Incomplete(Needed::Unknown))
626
        } else {
627
404k
          Err(Err::Error(OM::Error::bind(|| {
628
            let e: ErrorKind = ErrorKind::TakeUntil;
629
            Error::from_error_kind(i, e)
630
          })))
631
        }
632
      }
633
134k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
634
    }
635
539k
  }
Unexecuted instantiation: <nom::bytes::TakeUntil<_, _> as nom::internal::Parser<_>>::process::<_>
636
}
637
638
/// Returns the non empty input slice up to the first occurrence of the pattern.
639
///
640
/// It doesn't consume the pattern.
641
///
642
/// # Streaming Specific
643
/// *Streaming version* will return a `Err::Incomplete(Needed::new(N))` if the input doesn't
644
/// contain the pattern or if the input is smaller than the pattern.
645
/// # Example
646
/// ```rust
647
/// # use nom::{Err, error::{Error, ErrorKind}, Needed, IResult};
648
/// use nom::bytes::streaming::take_until1;
649
///
650
/// fn until_eof(s: &str) -> IResult<&str, &str> {
651
///   take_until1("eof")(s)
652
/// }
653
///
654
/// assert_eq!(until_eof("hello, worldeof"), Ok(("eof", "hello, world")));
655
/// assert_eq!(until_eof("hello, world"), Err(Err::Incomplete(Needed::Unknown)));
656
/// assert_eq!(until_eof("hello, worldeo"), Err(Err::Incomplete(Needed::Unknown)));
657
/// assert_eq!(until_eof("1eof2eof"), Ok(("eof2eof", "1")));
658
/// assert_eq!(until_eof("eof"),  Err(Err::Error(Error::new("eof", ErrorKind::TakeUntil))));
659
/// ```
660
915k
pub fn take_until1<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
661
915k
where
662
915k
  I: Input + FindSubstring<T>,
663
915k
  T: Clone,
664
{
665
915k
  TakeUntil1 {
666
915k
    tag,
667
915k
    e: PhantomData,
668
915k
  }
669
915k
}
nom::bytes::take_until1::<&[u8], &[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>
Line
Count
Source
660
915k
pub fn take_until1<T, I, Error: ParseError<I>>(tag: T) -> impl Parser<I, Output = I, Error = Error>
661
915k
where
662
915k
  I: Input + FindSubstring<T>,
663
915k
  T: Clone,
664
{
665
915k
  TakeUntil1 {
666
915k
    tag,
667
915k
    e: PhantomData,
668
915k
  }
669
915k
}
Unexecuted instantiation: nom::bytes::take_until1::<_, _, _>
670
671
/// Parser implementation for take_until1
672
pub struct TakeUntil1<T, E> {
673
  tag: T,
674
  e: PhantomData<E>,
675
}
676
677
impl<I, T, Error: ParseError<I>> Parser<I> for TakeUntil1<T, Error>
678
where
679
  I: Input + FindSubstring<T>,
680
  T: Clone,
681
{
682
  type Output = I;
683
  type Error = Error;
684
685
910k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
686
910k
    match i.find_substring(self.tag.clone()) {
687
      None => {
688
5.75k
        if OM::Incomplete::is_streaming() {
689
5.75k
          Err(Err::Incomplete(Needed::Unknown))
690
        } else {
691
0
          Err(Err::Error(OM::Error::bind(|| {
692
0
            let e: ErrorKind = ErrorKind::TakeUntil;
693
0
            Error::from_error_kind(i, e)
694
0
          })))
Unexecuted instantiation: <nom::bytes::TakeUntil1<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#0}
Unexecuted instantiation: <nom::bytes::TakeUntil1<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#0}
695
        }
696
      }
697
9.07k
      Some(0) => Err(Err::Error(OM::Error::bind(|| {
698
9.07k
        Error::from_error_kind(i, ErrorKind::TakeUntil)
699
9.07k
      }))),
<nom::bytes::TakeUntil1<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#1}
Line
Count
Source
697
9.07k
      Some(0) => Err(Err::Error(OM::Error::bind(|| {
698
9.07k
        Error::from_error_kind(i, ErrorKind::TakeUntil)
699
9.07k
      }))),
Unexecuted instantiation: <nom::bytes::TakeUntil1<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#1}
700
701
895k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
<nom::bytes::TakeUntil1<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>::{closure#2}
Line
Count
Source
701
895k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
Unexecuted instantiation: <nom::bytes::TakeUntil1<_, _> as nom::internal::Parser<_>>::process::<_>::{closure#2}
702
    }
703
910k
  }
<nom::bytes::TakeUntil1<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>> as nom::internal::Parser<&[u8]>>::process::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>>
Line
Count
Source
685
910k
  fn process<OM: OutputMode>(&mut self, i: I) -> crate::PResult<OM, I, Self::Output, Self::Error> {
686
910k
    match i.find_substring(self.tag.clone()) {
687
      None => {
688
5.75k
        if OM::Incomplete::is_streaming() {
689
5.75k
          Err(Err::Incomplete(Needed::Unknown))
690
        } else {
691
0
          Err(Err::Error(OM::Error::bind(|| {
692
            let e: ErrorKind = ErrorKind::TakeUntil;
693
            Error::from_error_kind(i, e)
694
          })))
695
        }
696
      }
697
9.07k
      Some(0) => Err(Err::Error(OM::Error::bind(|| {
698
        Error::from_error_kind(i, ErrorKind::TakeUntil)
699
      }))),
700
701
895k
      Some(index) => Ok((i.take_from(index), OM::Output::bind(|| i.take(index)))),
702
    }
703
910k
  }
Unexecuted instantiation: <nom::bytes::TakeUntil1<_, _> as nom::internal::Parser<_>>::process::<_>
704
}
705
706
/// Matches a byte string with escaped characters.
707
///
708
/// * The first argument matches the normal characters (it must not accept the control character)
709
/// * The second argument is the control character (like `\` in most languages)
710
/// * The third argument matches the escaped characters
711
/// # Example
712
/// ```
713
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
714
/// # use nom::character::complete::digit1;
715
/// use nom::bytes::streaming::escaped;
716
/// use nom::character::streaming::one_of;
717
///
718
/// fn esc(s: &str) -> IResult<&str, &str> {
719
///   escaped(digit1, '\\', one_of("\"n\\"))(s)
720
/// }
721
///
722
/// assert_eq!(esc("123;"), Ok((";", "123")));
723
/// assert_eq!(esc("12\\\"34;"), Ok((";", "12\\\"34")));
724
/// ```
725
///
726
0
pub fn escaped<I, Error, F, G>(
727
0
  normal: F,
728
0
  control_char: char,
729
0
  escapable: G,
730
0
) -> impl Parser<I, Output = I, Error = Error>
731
0
where
732
0
  I: Input + Clone + crate::traits::Offset,
733
0
  <I as Input>::Item: crate::traits::AsChar,
734
0
  F: Parser<I, Error = Error>,
735
0
  G: Parser<I, Error = Error>,
736
0
  Error: ParseError<I>,
737
{
738
0
  Escaped {
739
0
    normal,
740
0
    escapable,
741
0
    control_char,
742
0
    e: PhantomData,
743
0
  }
744
0
}
745
746
/// Parser implementation for [escaped]
747
pub struct Escaped<F, G, E> {
748
  normal: F,
749
  escapable: G,
750
  control_char: char,
751
  e: PhantomData<E>,
752
}
753
754
impl<I, Error: ParseError<I>, F, G> Parser<I> for Escaped<F, G, Error>
755
where
756
  I: Input + Clone + crate::traits::Offset,
757
  <I as Input>::Item: crate::traits::AsChar,
758
  F: Parser<I, Error = Error>,
759
  G: Parser<I, Error = Error>,
760
  Error: ParseError<I>,
761
{
762
  type Output = I;
763
  type Error = Error;
764
765
0
  fn process<OM: OutputMode>(
766
0
    &mut self,
767
0
    input: I,
768
0
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
769
0
    let mut i = input.clone();
770
771
0
    while i.input_len() > 0 {
772
0
      let current_len = i.input_len();
773
774
0
      match self
775
0
        .normal
776
0
        .process::<OutputM<Check, Check, OM::Incomplete>>(i.clone())
777
      {
778
0
        Ok((i2, _)) => {
779
0
          if i2.input_len() == 0 {
780
0
            if OM::Incomplete::is_streaming() {
781
0
              return Err(Err::Incomplete(Needed::Unknown));
782
            } else {
783
0
              let index = input.input_len();
784
              return Ok((
785
0
                input.take_from(index),
786
0
                OM::Output::bind(|| input.take(index)),
787
              ));
788
            }
789
0
          } else if i2.input_len() == current_len {
790
0
            let index = input.offset(&i2);
791
            return Ok((
792
0
              input.take_from(index),
793
0
              OM::Output::bind(|| input.take(index)),
794
            ));
795
0
          } else {
796
0
            i = i2;
797
0
          }
798
        }
799
        Err(Err::Error(_)) => {
800
          // unwrap() should be safe here since index < $i.input_len()
801
0
          if i.iter_elements().next().unwrap().as_char() == self.control_char {
802
0
            let next = self.control_char.len_utf8();
803
0
            if next >= i.input_len() {
804
0
              if OM::Incomplete::is_streaming() {
805
0
                return Err(Err::Incomplete(Needed::new(1)));
806
              } else {
807
0
                return Err(Err::Error(OM::Error::bind(|| {
808
0
                  Error::from_error_kind(input, ErrorKind::Escaped)
809
0
                })));
810
              }
811
            } else {
812
0
              match self
813
0
                .escapable
814
0
                .process::<OutputM<Check, OM::Error, OM::Incomplete>>(i.take_from(next))
815
              {
816
0
                Ok((i2, _)) => {
817
0
                  if i2.input_len() == 0 {
818
0
                    if OM::Incomplete::is_streaming() {
819
0
                      return Err(Err::Incomplete(Needed::Unknown));
820
                    } else {
821
0
                      let index = input.input_len();
822
                      return Ok((
823
0
                        input.take_from(index),
824
0
                        OM::Output::bind(|| input.take(index)),
825
                      ));
826
                    }
827
0
                  } else {
828
0
                    i = i2;
829
0
                  }
830
                }
831
0
                Err(e) => return Err(e),
832
              }
833
            }
834
          } else {
835
0
            let index = input.offset(&i);
836
0
            if index == 0 {
837
0
              return Err(Err::Error(OM::Error::bind(|| {
838
0
                Error::from_error_kind(input, ErrorKind::Escaped)
839
0
              })));
840
            } else {
841
              return Ok((
842
0
                input.take_from(index),
843
0
                OM::Output::bind(|| input.take(index)),
844
              ));
845
            }
846
          }
847
        }
848
0
        Err(Err::Failure(e)) => {
849
0
          return Err(Err::Failure(e));
850
        }
851
0
        Err(Err::Incomplete(i)) => {
852
0
          return Err(Err::Incomplete(i));
853
        }
854
      }
855
    }
856
857
0
    if OM::Incomplete::is_streaming() {
858
0
      Err(Err::Incomplete(Needed::Unknown))
859
    } else {
860
0
      let index = input.input_len();
861
      Ok((
862
0
        input.take_from(index),
863
0
        OM::Output::bind(|| input.take(index)),
864
      ))
865
    }
866
0
  }
867
}
868
869
/// Matches a byte string with escaped characters.
870
///
871
/// * The first argument matches the normal characters (it must not match the control character)
872
/// * The second argument is the control character (like `\` in most languages)
873
/// * The third argument matches the escaped characters and transforms them
874
///
875
/// As an example, the chain `abc\tdef` could be `abc    def` (it also consumes the control character)
876
///
877
/// ```
878
/// # use nom::{Err, error::ErrorKind, Needed, IResult};
879
/// # use std::str::from_utf8;
880
/// use nom::bytes::streaming::{escaped_transform, tag};
881
/// use nom::character::streaming::alpha1;
882
/// use nom::branch::alt;
883
/// use nom::combinator::value;
884
///
885
/// fn parser(input: &str) -> IResult<&str, String> {
886
///   escaped_transform(
887
///     alpha1,
888
///     '\\',
889
///     alt((
890
///       value("\\", tag("\\")),
891
///       value("\"", tag("\"")),
892
///       value("\n", tag("n")),
893
///     ))
894
///   )(input)
895
/// }
896
///
897
/// assert_eq!(parser("ab\\\"cd\""), Ok(("\"", String::from("ab\"cd"))));
898
/// ```
899
#[cfg(feature = "alloc")]
900
#[cfg_attr(feature = "docsrs", doc(cfg(feature = "alloc")))]
901
0
pub fn escaped_transform<I, Error, F, G, ExtendItem, Output>(
902
0
  normal: F,
903
0
  control_char: char,
904
0
  transform: G,
905
0
) -> impl Parser<I, Output = Output, Error = Error>
906
0
where
907
0
  I: Clone + crate::traits::Offset + Input,
908
0
  I: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
909
0
  <F as Parser<I>>::Output: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
910
0
  <G as Parser<I>>::Output: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
911
0
  <I as Input>::Item: crate::traits::AsChar,
912
0
  F: Parser<I, Error = Error>,
913
0
  G: Parser<I, Error = Error>,
914
0
  Error: ParseError<I>,
915
{
916
0
  EscapedTransform {
917
0
    normal,
918
0
    control_char,
919
0
    transform,
920
0
    e: PhantomData,
921
0
    extend: PhantomData,
922
0
    o: PhantomData,
923
0
  }
924
0
}
925
926
/// Parser implementation for [escaped_transform]
927
pub struct EscapedTransform<F, G, E, ExtendItem, Output> {
928
  normal: F,
929
  transform: G,
930
  control_char: char,
931
  e: PhantomData<E>,
932
  extend: PhantomData<ExtendItem>,
933
  o: PhantomData<Output>,
934
}
935
936
impl<I, Error: ParseError<I>, F, G, ExtendItem, Output> Parser<I>
937
  for EscapedTransform<F, G, Error, ExtendItem, Output>
938
where
939
  I: Clone + crate::traits::Offset + Input,
940
  I: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
941
  <F as Parser<I>>::Output: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
942
  <G as Parser<I>>::Output: crate::traits::ExtendInto<Item = ExtendItem, Extender = Output>,
943
  <I as Input>::Item: crate::traits::AsChar,
944
  F: Parser<I, Error = Error>,
945
  G: Parser<I, Error = Error>,
946
  Error: ParseError<I>,
947
{
948
  type Output = Output;
949
  type Error = Error;
950
951
0
  fn process<OM: OutputMode>(
952
0
    &mut self,
953
0
    input: I,
954
0
  ) -> crate::PResult<OM, I, Self::Output, Self::Error> {
955
0
    let mut index = 0;
956
0
    let mut res = OM::Output::bind(|| input.new_builder());
957
958
0
    while index < input.input_len() {
959
0
      let current_len = input.input_len();
960
0
      let remainder = input.take_from(index);
961
0
      match self.normal.process::<OM>(remainder.clone()) {
962
0
        Ok((i2, o)) => {
963
0
          res = OM::Output::combine(o, res, |o, mut res| {
964
0
            o.extend_into(&mut res);
965
0
            res
966
0
          });
967
0
          if i2.input_len() == 0 {
968
0
            if OM::Incomplete::is_streaming() {
969
0
              return Err(Err::Incomplete(Needed::Unknown));
970
            } else {
971
0
              let index = input.input_len();
972
0
              return Ok((input.take_from(index), res));
973
            }
974
0
          } else if i2.input_len() == current_len {
975
0
            return Ok((remainder, res));
976
0
          } else {
977
0
            index = input.offset(&i2);
978
0
          }
979
        }
980
        Err(Err::Error(_)) => {
981
          // unwrap() should be safe here since index < $i.input_len()
982
0
          if remainder.iter_elements().next().unwrap().as_char() == self.control_char {
983
0
            let next = index + self.control_char.len_utf8();
984
0
            let input_len = input.input_len();
985
986
0
            if next >= input_len {
987
0
              if OM::Incomplete::is_streaming() {
988
0
                return Err(Err::Incomplete(Needed::Unknown));
989
              } else {
990
0
                return Err(Err::Error(OM::Error::bind(|| {
991
0
                  Error::from_error_kind(remainder, ErrorKind::EscapedTransform)
992
0
                })));
993
              }
994
            } else {
995
0
              match self.transform.process::<OM>(input.take_from(next)) {
996
0
                Ok((i2, o)) => {
997
0
                  res = OM::Output::combine(o, res, |o, mut res| {
998
0
                    o.extend_into(&mut res);
999
0
                    res
1000
0
                  });
1001
0
                  if i2.input_len() == 0 {
1002
0
                    if OM::Incomplete::is_streaming() {
1003
0
                      return Err(Err::Incomplete(Needed::Unknown));
1004
                    } else {
1005
0
                      return Ok((input.take_from(input.input_len()), res));
1006
                    }
1007
0
                  } else {
1008
0
                    index = input.offset(&i2);
1009
0
                  }
1010
                }
1011
0
                Err(Err::Error(e)) => return Err(Err::Error(e)),
1012
0
                Err(Err::Failure(e)) => {
1013
0
                  return Err(Err::Failure(e));
1014
                }
1015
0
                Err(Err::Incomplete(i)) => {
1016
0
                  return Err(Err::Incomplete(i));
1017
                }
1018
              }
1019
            }
1020
          } else {
1021
0
            if index == 0 {
1022
0
              return Err(Err::Error(OM::Error::bind(|| {
1023
0
                Error::from_error_kind(remainder, ErrorKind::EscapedTransform)
1024
0
              })));
1025
0
            }
1026
0
            return Ok((remainder, res));
1027
          }
1028
        }
1029
0
        Err(Err::Failure(e)) => {
1030
0
          return Err(Err::Failure(e));
1031
        }
1032
0
        Err(Err::Incomplete(i)) => {
1033
0
          return Err(Err::Incomplete(i));
1034
        }
1035
      }
1036
    }
1037
1038
0
    if OM::Incomplete::is_streaming() {
1039
0
      Err(Err::Incomplete(Needed::Unknown))
1040
    } else {
1041
0
      Ok((input.take_from(index), res))
1042
    }
1043
0
  }
1044
}