/rust/registry/src/index.crates.io-1949cf8c6b5b557f/nom-8.0.0/src/traits.rs
Line | Count | Source |
1 | | //! Traits input types have to implement to work with nom combinators |
2 | | use core::iter::Enumerate; |
3 | | use core::str::CharIndices; |
4 | | |
5 | | use crate::error::{ErrorKind, ParseError}; |
6 | | use crate::internal::{Err, IResult, Needed}; |
7 | | use crate::lib::std::iter::Copied; |
8 | | use crate::lib::std::ops::{ |
9 | | Bound, Range, RangeBounds, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive, |
10 | | }; |
11 | | use crate::lib::std::slice::Iter; |
12 | | use crate::lib::std::str::from_utf8; |
13 | | use crate::lib::std::str::Chars; |
14 | | use crate::lib::std::str::FromStr; |
15 | | use crate::IsStreaming; |
16 | | use crate::Mode; |
17 | | |
18 | | #[cfg(feature = "alloc")] |
19 | | use crate::lib::std::string::String; |
20 | | #[cfg(feature = "alloc")] |
21 | | use crate::lib::std::vec::Vec; |
22 | | |
23 | | /// Parser input types must implement this trait |
24 | | pub trait Input: Clone + Sized { |
25 | | /// The current input type is a sequence of that `Item` type. |
26 | | /// |
27 | | /// Example: `u8` for `&[u8]` or `char` for `&str` |
28 | | type Item; |
29 | | |
30 | | /// An iterator over the input type, producing the item |
31 | | type Iter: Iterator<Item = Self::Item>; |
32 | | |
33 | | /// An iterator over the input type, producing the item and its byte position |
34 | | /// If we're iterating over `&str`, the position |
35 | | /// corresponds to the byte index of the character |
36 | | type IterIndices: Iterator<Item = (usize, Self::Item)>; |
37 | | |
38 | | /// Calculates the input length, as indicated by its name, |
39 | | /// and the name of the trait itself |
40 | | fn input_len(&self) -> usize; |
41 | | |
42 | | /// Returns a slice of `index` bytes. panics if index > length |
43 | | fn take(&self, index: usize) -> Self; |
44 | | /// Returns a slice starting at `index` bytes. panics if index > length |
45 | | fn take_from(&self, index: usize) -> Self; |
46 | | /// Split the stream at the `index` byte offset. panics if index > length |
47 | | fn take_split(&self, index: usize) -> (Self, Self); |
48 | | |
49 | | /// Returns the byte position of the first element satisfying the predicate |
50 | | fn position<P>(&self, predicate: P) -> Option<usize> |
51 | | where |
52 | | P: Fn(Self::Item) -> bool; |
53 | | |
54 | | /// Returns an iterator over the elements |
55 | | fn iter_elements(&self) -> Self::Iter; |
56 | | /// Returns an iterator over the elements and their byte offsets |
57 | | fn iter_indices(&self) -> Self::IterIndices; |
58 | | |
59 | | /// Get the byte offset from the element's position in the stream |
60 | | fn slice_index(&self, count: usize) -> Result<usize, Needed>; |
61 | | |
62 | | /// Looks for the first element of the input type for which the condition returns true, |
63 | | /// and returns the input up to this position. |
64 | | /// |
65 | | /// *streaming version*: If no element is found matching the condition, this will return `Incomplete` |
66 | 0 | fn split_at_position<P, E: ParseError<Self>>(&self, predicate: P) -> IResult<Self, Self, E> |
67 | 0 | where |
68 | 0 | P: Fn(Self::Item) -> bool, |
69 | | { |
70 | 0 | match self.position(predicate) { |
71 | 0 | Some(n) => Ok(self.take_split(n)), |
72 | 0 | None => Err(Err::Incomplete(Needed::new(1))), |
73 | | } |
74 | 0 | } |
75 | | |
76 | | /// Looks for the first element of the input type for which the condition returns true |
77 | | /// and returns the input up to this position. |
78 | | /// |
79 | | /// Fails if the produced slice is empty. |
80 | | /// |
81 | | /// *streaming version*: If no element is found matching the condition, this will return `Incomplete` |
82 | 0 | fn split_at_position1<P, E: ParseError<Self>>( |
83 | 0 | &self, |
84 | 0 | predicate: P, |
85 | 0 | e: ErrorKind, |
86 | 0 | ) -> IResult<Self, Self, E> |
87 | 0 | where |
88 | 0 | P: Fn(Self::Item) -> bool, |
89 | | { |
90 | 0 | match self.position(predicate) { |
91 | 0 | Some(0) => Err(Err::Error(E::from_error_kind(self.clone(), e))), |
92 | 0 | Some(n) => Ok(self.take_split(n)), |
93 | 0 | None => Err(Err::Incomplete(Needed::new(1))), |
94 | | } |
95 | 0 | } |
96 | | |
97 | | /// Looks for the first element of the input type for which the condition returns true, |
98 | | /// and returns the input up to this position. |
99 | | /// |
100 | | /// *complete version*: If no element is found matching the condition, this will return the whole input |
101 | 0 | fn split_at_position_complete<P, E: ParseError<Self>>( |
102 | 0 | &self, |
103 | 0 | predicate: P, |
104 | 0 | ) -> IResult<Self, Self, E> |
105 | 0 | where |
106 | 0 | P: Fn(Self::Item) -> bool, |
107 | | { |
108 | 0 | match self.split_at_position(predicate) { |
109 | 0 | Err(Err::Incomplete(_)) => Ok(self.take_split(self.input_len())), |
110 | 0 | res => res, |
111 | | } |
112 | 0 | } |
113 | | |
114 | | /// Looks for the first element of the input type for which the condition returns true |
115 | | /// and returns the input up to this position. |
116 | | /// |
117 | | /// Fails if the produced slice is empty. |
118 | | /// |
119 | | /// *complete version*: If no element is found matching the condition, this will return the whole input |
120 | 0 | fn split_at_position1_complete<P, E: ParseError<Self>>( |
121 | 0 | &self, |
122 | 0 | predicate: P, |
123 | 0 | e: ErrorKind, |
124 | 0 | ) -> IResult<Self, Self, E> |
125 | 0 | where |
126 | 0 | P: Fn(Self::Item) -> bool, |
127 | | { |
128 | 0 | match self.split_at_position1(predicate, e) { |
129 | | Err(Err::Incomplete(_)) => { |
130 | 0 | if self.input_len() == 0 { |
131 | 0 | Err(Err::Error(E::from_error_kind(self.clone(), e))) |
132 | | } else { |
133 | 0 | Ok(self.take_split(self.input_len())) |
134 | | } |
135 | | } |
136 | 0 | res => res, |
137 | | } |
138 | 0 | } |
139 | | |
140 | | /// mode version of split_at_position |
141 | 0 | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( |
142 | 0 | &self, |
143 | 0 | predicate: P, |
144 | 0 | ) -> crate::PResult<OM, Self, Self, E> |
145 | 0 | where |
146 | 0 | P: Fn(Self::Item) -> bool, |
147 | | { |
148 | 0 | match self.position(predicate) { |
149 | 0 | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
150 | | None => { |
151 | 0 | if OM::Incomplete::is_streaming() { |
152 | 0 | Err(Err::Incomplete(Needed::new(1))) |
153 | | } else { |
154 | 0 | let len = self.input_len(); |
155 | 0 | Ok((self.take_from(len), OM::Output::bind(|| self.take(len)))) |
156 | | } |
157 | | } |
158 | | } |
159 | 0 | } |
160 | | |
161 | | /// mode version of split_at_position |
162 | 0 | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( |
163 | 0 | &self, |
164 | 0 | predicate: P, |
165 | 0 | e: ErrorKind, |
166 | 0 | ) -> crate::PResult<OM, Self, Self, E> |
167 | 0 | where |
168 | 0 | P: Fn(Self::Item) -> bool, |
169 | | { |
170 | 0 | match self.position(predicate) { |
171 | 0 | Some(0) => Err(Err::Error(OM::Error::bind(|| { |
172 | 0 | E::from_error_kind(self.clone(), e) |
173 | 0 | }))), |
174 | 0 | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
175 | | None => { |
176 | 0 | if OM::Incomplete::is_streaming() { |
177 | 0 | Err(Err::Incomplete(Needed::new(1))) |
178 | | } else { |
179 | 0 | let len = self.input_len(); |
180 | 0 | if len == 0 { |
181 | 0 | Err(Err::Error(OM::Error::bind(|| { |
182 | 0 | E::from_error_kind(self.clone(), e) |
183 | 0 | }))) |
184 | | } else { |
185 | 0 | Ok((self.take_from(len), OM::Output::bind(|| self.take(len)))) |
186 | | } |
187 | | } |
188 | | } |
189 | | } |
190 | 0 | } |
191 | | } |
192 | | |
193 | | impl<'a> Input for &'a [u8] { |
194 | | type Item = u8; |
195 | | type Iter = Copied<Iter<'a, u8>>; |
196 | | type IterIndices = Enumerate<Self::Iter>; |
197 | | |
198 | 746M | fn input_len(&self) -> usize { |
199 | 746M | self.len() |
200 | 746M | } |
201 | | |
202 | | #[inline] |
203 | 386M | fn take(&self, index: usize) -> Self { |
204 | 386M | &self[0..index] |
205 | 386M | } |
206 | | |
207 | 1.09G | fn take_from(&self, index: usize) -> Self { |
208 | 1.09G | &self[index..] |
209 | 1.09G | } |
210 | | #[inline] |
211 | 33.9M | fn take_split(&self, index: usize) -> (Self, Self) { |
212 | 33.9M | let (prefix, suffix) = self.split_at(index); |
213 | 33.9M | (suffix, prefix) |
214 | 33.9M | } |
215 | | |
216 | | #[inline] |
217 | 0 | fn position<P>(&self, predicate: P) -> Option<usize> |
218 | 0 | where |
219 | 0 | P: Fn(Self::Item) -> bool, |
220 | | { |
221 | 0 | self.iter().position(|b| predicate(*b)) |
222 | 0 | } |
223 | | |
224 | | #[inline] |
225 | 747M | fn iter_elements(&self) -> Self::Iter { |
226 | 747M | self.iter().copied() |
227 | 747M | } |
228 | | |
229 | | #[inline] |
230 | 39.3M | fn iter_indices(&self) -> Self::IterIndices { |
231 | 39.3M | self.iter_elements().enumerate() |
232 | 39.3M | } |
233 | | |
234 | | #[inline] |
235 | 175M | fn slice_index(&self, count: usize) -> Result<usize, Needed> { |
236 | 175M | if self.len() >= count { |
237 | 171M | Ok(count) |
238 | | } else { |
239 | 4.19M | Err(Needed::new(count - self.len())) |
240 | | } |
241 | 175M | } |
242 | | |
243 | | #[inline(always)] |
244 | 11.7M | fn split_at_position<P, E: ParseError<Self>>(&self, predicate: P) -> IResult<Self, Self, E> |
245 | 11.7M | where |
246 | 11.7M | P: Fn(Self::Item) -> bool, |
247 | | { |
248 | 14.1M | match self.iter().position(|c| predicate(*c)) {<&[u8] as nom::traits::Input>::split_at_position::<nom::character::streaming::space0<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 248 | 14.1M | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position::<_, _>::{closure#0} |
249 | 11.7M | Some(i) => Ok(self.take_split(i)), |
250 | 58.9k | None => Err(Err::Incomplete(Needed::new(1))), |
251 | | } |
252 | 11.7M | } <&[u8] as nom::traits::Input>::split_at_position::<nom::character::streaming::space0<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 244 | 11.7M | fn split_at_position<P, E: ParseError<Self>>(&self, predicate: P) -> IResult<Self, Self, E> | 245 | 11.7M | where | 246 | 11.7M | P: Fn(Self::Item) -> bool, | 247 | | { | 248 | 11.7M | match self.iter().position(|c| predicate(*c)) { | 249 | 11.7M | Some(i) => Ok(self.take_split(i)), | 250 | 58.9k | None => Err(Err::Incomplete(Needed::new(1))), | 251 | | } | 252 | 11.7M | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position::<_, _> |
253 | | |
254 | | #[inline(always)] |
255 | 10.9k | fn split_at_position1<P, E: ParseError<Self>>( |
256 | 10.9k | &self, |
257 | 10.9k | predicate: P, |
258 | 10.9k | e: ErrorKind, |
259 | 10.9k | ) -> IResult<Self, Self, E> |
260 | 10.9k | where |
261 | 10.9k | P: Fn(Self::Item) -> bool, |
262 | | { |
263 | 34.6k | match self.iter().position(|c| predicate(*c)) {<&[u8] as nom::traits::Input>::split_at_position1::<nom::character::streaming::alphanumeric1<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>::{closure#0}, suricata::pgsql::parser::PgsqlParseError<&[u8]>>::{closure#0}Line | Count | Source | 263 | 34.6k | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position1::<_, _>::{closure#0} |
264 | 1.15k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), |
265 | 8.98k | Some(i) => Ok(self.take_split(i)), |
266 | 836 | None => Err(Err::Incomplete(Needed::new(1))), |
267 | | } |
268 | 10.9k | } <&[u8] as nom::traits::Input>::split_at_position1::<nom::character::streaming::alphanumeric1<&[u8], suricata::pgsql::parser::PgsqlParseError<&[u8]>>::{closure#0}, suricata::pgsql::parser::PgsqlParseError<&[u8]>>Line | Count | Source | 255 | 10.9k | fn split_at_position1<P, E: ParseError<Self>>( | 256 | 10.9k | &self, | 257 | 10.9k | predicate: P, | 258 | 10.9k | e: ErrorKind, | 259 | 10.9k | ) -> IResult<Self, Self, E> | 260 | 10.9k | where | 261 | 10.9k | P: Fn(Self::Item) -> bool, | 262 | | { | 263 | 10.9k | match self.iter().position(|c| predicate(*c)) { | 264 | 1.15k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 265 | 8.98k | Some(i) => Ok(self.take_split(i)), | 266 | 836 | None => Err(Err::Incomplete(Needed::new(1))), | 267 | | } | 268 | 10.9k | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position1::<_, _> |
269 | | |
270 | 481k | fn split_at_position_complete<P, E: ParseError<Self>>( |
271 | 481k | &self, |
272 | 481k | predicate: P, |
273 | 481k | ) -> IResult<Self, Self, E> |
274 | 481k | where |
275 | 481k | P: Fn(Self::Item) -> bool, |
276 | | { |
277 | 511k | match self.iter().position(|c| predicate(*c)) {<&[u8] as nom::traits::Input>::split_at_position_complete::<nom::character::complete::multispace0<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 277 | 511k | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_complete::<_, _>::{closure#0} |
278 | 464k | Some(i) => Ok(self.take_split(i)), |
279 | 17.5k | None => Ok(self.take_split(self.len())), |
280 | | } |
281 | 481k | } <&[u8] as nom::traits::Input>::split_at_position_complete::<nom::character::complete::multispace0<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 270 | 481k | fn split_at_position_complete<P, E: ParseError<Self>>( | 271 | 481k | &self, | 272 | 481k | predicate: P, | 273 | 481k | ) -> IResult<Self, Self, E> | 274 | 481k | where | 275 | 481k | P: Fn(Self::Item) -> bool, | 276 | | { | 277 | 481k | match self.iter().position(|c| predicate(*c)) { | 278 | 464k | Some(i) => Ok(self.take_split(i)), | 279 | 17.5k | None => Ok(self.take_split(self.len())), | 280 | | } | 281 | 481k | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_complete::<_, _> |
282 | | |
283 | | #[inline(always)] |
284 | 7.37M | fn split_at_position1_complete<P, E: ParseError<Self>>( |
285 | 7.37M | &self, |
286 | 7.37M | predicate: P, |
287 | 7.37M | e: ErrorKind, |
288 | 7.37M | ) -> IResult<Self, Self, E> |
289 | 7.37M | where |
290 | 7.37M | P: Fn(Self::Item) -> bool, |
291 | | { |
292 | 19.3M | match self.iter().position(|c| predicate(*c)) {<&[u8] as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 292 | 8.52M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::space1<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 292 | 9.69M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 292 | 1.10M | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position1_complete::<_, _>::{closure#0} |
293 | 102k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), |
294 | 6.88M | Some(i) => Ok(self.take_split(i)), |
295 | | None => { |
296 | 392k | if self.is_empty() { |
297 | 34.4k | Err(Err::Error(E::from_error_kind(self, e))) |
298 | | } else { |
299 | 358k | Ok(self.take_split(self.len())) |
300 | | } |
301 | | } |
302 | | } |
303 | 7.37M | } <&[u8] as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 284 | 2.40M | fn split_at_position1_complete<P, E: ParseError<Self>>( | 285 | 2.40M | &self, | 286 | 2.40M | predicate: P, | 287 | 2.40M | e: ErrorKind, | 288 | 2.40M | ) -> IResult<Self, Self, E> | 289 | 2.40M | where | 290 | 2.40M | P: Fn(Self::Item) -> bool, | 291 | | { | 292 | 2.40M | match self.iter().position(|c| predicate(*c)) { | 293 | 20.4k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 294 | 2.27M | Some(i) => Ok(self.take_split(i)), | 295 | | None => { | 296 | 101k | if self.is_empty() { | 297 | 12.6k | Err(Err::Error(E::from_error_kind(self, e))) | 298 | | } else { | 299 | 88.5k | Ok(self.take_split(self.len())) | 300 | | } | 301 | | } | 302 | | } | 303 | 2.40M | } |
<&[u8] as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::space1<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 284 | 4.63M | fn split_at_position1_complete<P, E: ParseError<Self>>( | 285 | 4.63M | &self, | 286 | 4.63M | predicate: P, | 287 | 4.63M | e: ErrorKind, | 288 | 4.63M | ) -> IResult<Self, Self, E> | 289 | 4.63M | where | 290 | 4.63M | P: Fn(Self::Item) -> bool, | 291 | | { | 292 | 4.63M | match self.iter().position(|c| predicate(*c)) { | 293 | 81.5k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 294 | 4.53M | Some(i) => Ok(self.take_split(i)), | 295 | | None => { | 296 | 10.5k | if self.is_empty() { | 297 | 6.81k | Err(Err::Error(E::from_error_kind(self, e))) | 298 | | } else { | 299 | 3.70k | Ok(self.take_split(self.len())) | 300 | | } | 301 | | } | 302 | | } | 303 | 4.63M | } |
<&[u8] as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::digit1<&[u8], nom::error::Error<&[u8]>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 284 | 347k | fn split_at_position1_complete<P, E: ParseError<Self>>( | 285 | 347k | &self, | 286 | 347k | predicate: P, | 287 | 347k | e: ErrorKind, | 288 | 347k | ) -> IResult<Self, Self, E> | 289 | 347k | where | 290 | 347k | P: Fn(Self::Item) -> bool, | 291 | | { | 292 | 347k | match self.iter().position(|c| predicate(*c)) { | 293 | 0 | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 294 | 66.7k | Some(i) => Ok(self.take_split(i)), | 295 | | None => { | 296 | 281k | if self.is_empty() { | 297 | 15.0k | Err(Err::Error(E::from_error_kind(self, e))) | 298 | | } else { | 299 | 266k | Ok(self.take_split(self.len())) | 300 | | } | 301 | | } | 302 | | } | 303 | 347k | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position1_complete::<_, _> |
304 | | |
305 | | /// mode version of split_at_position |
306 | | #[inline(always)] |
307 | 107M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( |
308 | 107M | &self, |
309 | 107M | predicate: P, |
310 | 107M | ) -> crate::PResult<OM, Self, Self, E> |
311 | 107M | where |
312 | 107M | P: Fn(Self::Item) -> bool, |
313 | | { |
314 | 904M | match self.iter().position(|c| predicate(*c)) {<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.86M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 2.10M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 10.6M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 14.3M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 5.36M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 13.0M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 23.3M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 3.77M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.33M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.24M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 162k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 141k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 151k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 265k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 18.7k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 3.83M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 2.02M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 3.09M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.12M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 6.52M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 500k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 21.0M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.19M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 46.5M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 58.1M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 7.67M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 441k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 997k | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&[u8]>>::{closure#0}<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 559k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 65.6M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 5.19M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 130k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 81.6k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 11.0M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 3.49M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.26M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 1.16M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 27.7M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 226M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 263M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 65.8M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 314 | 95.9k | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<_, _, _>::{closure#0}<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, (&[u8], nom::error::ErrorKind)>::{closure#0}Line | Count | Source | 314 | 1.14M | match self.iter().position(|c| predicate(*c)) { |
|
315 | 86.1M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 1.84M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 1.84M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 893k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 1.84M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 931k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 623k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 44.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 42.9k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 25.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 1.12M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 64.7k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 61.6k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 58.5k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 63.2k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 10.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 9.68k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 765k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 66.2k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 8.90k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 7.10k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 55.0k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 20.1M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 4.82k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 9.76M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 7.76M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 431k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 52.7k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 747k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&[u8]>>::{closure#1}<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 519k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 1.99M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 2.78M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 117k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 54.9k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 5.66M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 32.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 1.30k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 332k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 4.07M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 8.96M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 10.0M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 2.13M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 315 | 285 | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<_, _, _>::{closure#1}<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, (&[u8], nom::error::ErrorKind)>::{closure#1}Line | Count | Source | 315 | 10.8k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
|
316 | | None => { |
317 | 21.0M | if OM::Incomplete::is_streaming() { |
318 | 3.11M | Err(Err::Incomplete(Needed::new(1))) |
319 | | } else { |
320 | | Ok(( |
321 | 17.9M | self.take_from(self.len()), |
322 | 17.9M | OM::Output::bind(|| self.take(self.len())), Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 5.17k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 1.10k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 761 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 906 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 462 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 864 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 521 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 552 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 429 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 1.38k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 665 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 713 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 687 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 1.27k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 9.14M | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 3.06k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 359k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 1.89M | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 4.13k | OM::Output::bind(|| self.take(self.len())), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 327k | OM::Output::bind(|| self.take(self.len())), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&[u8]>>::{closure#2}<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 266k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 3.91M | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 643k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 14.4k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 3.99k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 1.28M | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 10.3k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 22.5k | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 322 | 15.0k | OM::Output::bind(|| self.take(self.len())), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<_, _, _>::{closure#2}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, (&[u8], nom::error::ErrorKind)>::{closure#2} |
323 | | )) |
324 | | } |
325 | | } |
326 | | } |
327 | 107M | } <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 1.84M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 1.84M | &self, | 309 | 1.84M | predicate: P, | 310 | 1.84M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 1.84M | where | 312 | 1.84M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 1.84M | match self.iter().position(|c| predicate(*c)) { | 315 | 1.84M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 253 | if OM::Incomplete::is_streaming() { | 318 | 253 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 1.84M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 1.84M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 1.84M | &self, | 309 | 1.84M | predicate: P, | 310 | 1.84M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 1.84M | where | 312 | 1.84M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 1.84M | match self.iter().position(|c| predicate(*c)) { | 315 | 1.84M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.76k | if OM::Incomplete::is_streaming() { | 318 | 1.76k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 1.84M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 893k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 893k | &self, | 309 | 893k | predicate: P, | 310 | 893k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 893k | where | 312 | 893k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 893k | match self.iter().position(|c| predicate(*c)) { | 315 | 893k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 170 | if OM::Incomplete::is_streaming() { | 318 | 170 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 893k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 1.84M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 1.84M | &self, | 309 | 1.84M | predicate: P, | 310 | 1.84M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 1.84M | where | 312 | 1.84M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 1.84M | match self.iter().position(|c| predicate(*c)) { | 315 | 1.84M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.18k | if OM::Incomplete::is_streaming() { | 318 | 1.18k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 1.84M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 934k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 934k | &self, | 309 | 934k | predicate: P, | 310 | 934k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 934k | where | 312 | 934k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 934k | match self.iter().position(|c| predicate(*c)) { | 315 | 931k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 2.40k | if OM::Incomplete::is_streaming() { | 318 | 2.40k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 934k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 624k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 624k | &self, | 309 | 624k | predicate: P, | 310 | 624k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 624k | where | 312 | 624k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 624k | match self.iter().position(|c| predicate(*c)) { | 315 | 623k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 485 | if OM::Incomplete::is_streaming() { | 318 | 485 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 624k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 56.8k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 56.8k | &self, | 309 | 56.8k | predicate: P, | 310 | 56.8k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 56.8k | where | 312 | 56.8k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 56.8k | match self.iter().position(|c| predicate(*c)) { | 315 | 44.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 12.6k | if OM::Incomplete::is_streaming() { | 318 | 12.6k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 56.8k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 48.1k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 48.1k | &self, | 309 | 48.1k | predicate: P, | 310 | 48.1k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 48.1k | where | 312 | 48.1k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 48.1k | match self.iter().position(|c| predicate(*c)) { | 315 | 42.9k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 5.17k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 5.17k | self.take_from(self.len()), | 322 | 5.17k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 48.1k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 26.2k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 26.2k | &self, | 309 | 26.2k | predicate: P, | 310 | 26.2k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 26.2k | where | 312 | 26.2k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 26.2k | match self.iter().position(|c| predicate(*c)) { | 315 | 25.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.10k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 1.10k | self.take_from(self.len()), | 322 | 1.10k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 26.2k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 1.12M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 1.12M | &self, | 309 | 1.12M | predicate: P, | 310 | 1.12M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 1.12M | where | 312 | 1.12M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 1.12M | match self.iter().position(|c| predicate(*c)) { | 315 | 1.12M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 761 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 761 | self.take_from(self.len()), | 322 | 761 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 1.12M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 65.7k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 65.7k | &self, | 309 | 65.7k | predicate: P, | 310 | 65.7k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 65.7k | where | 312 | 65.7k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 65.7k | match self.iter().position(|c| predicate(*c)) { | 315 | 64.7k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 906 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 906 | self.take_from(self.len()), | 322 | 906 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 65.7k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 62.1k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 62.1k | &self, | 309 | 62.1k | predicate: P, | 310 | 62.1k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 62.1k | where | 312 | 62.1k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 62.1k | match self.iter().position(|c| predicate(*c)) { | 315 | 61.6k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 462 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 462 | self.take_from(self.len()), | 322 | 462 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 62.1k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 59.3k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 59.3k | &self, | 309 | 59.3k | predicate: P, | 310 | 59.3k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 59.3k | where | 312 | 59.3k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 59.3k | match self.iter().position(|c| predicate(*c)) { | 315 | 58.5k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 864 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 864 | self.take_from(self.len()), | 322 | 864 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 59.3k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 63.8k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 63.8k | &self, | 309 | 63.8k | predicate: P, | 310 | 63.8k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 63.8k | where | 312 | 63.8k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 63.8k | match self.iter().position(|c| predicate(*c)) { | 315 | 63.2k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 521 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 521 | self.take_from(self.len()), | 322 | 521 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 63.8k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 10.7k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 10.7k | &self, | 309 | 10.7k | predicate: P, | 310 | 10.7k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 10.7k | where | 312 | 10.7k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 10.7k | match self.iter().position(|c| predicate(*c)) { | 315 | 10.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 552 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 552 | self.take_from(self.len()), | 322 | 552 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 10.7k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 10.1k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 10.1k | &self, | 309 | 10.1k | predicate: P, | 310 | 10.1k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 10.1k | where | 312 | 10.1k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 10.1k | match self.iter().position(|c| predicate(*c)) { | 315 | 9.68k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 429 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 429 | self.take_from(self.len()), | 322 | 429 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 10.1k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 766k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 766k | &self, | 309 | 766k | predicate: P, | 310 | 766k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 766k | where | 312 | 766k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 766k | match self.iter().position(|c| predicate(*c)) { | 315 | 765k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.38k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 1.38k | self.take_from(self.len()), | 322 | 1.38k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 766k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 66.9k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 66.9k | &self, | 309 | 66.9k | predicate: P, | 310 | 66.9k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 66.9k | where | 312 | 66.9k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 66.9k | match self.iter().position(|c| predicate(*c)) { | 315 | 66.2k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 665 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 665 | self.take_from(self.len()), | 322 | 665 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 66.9k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 9.62k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 9.62k | &self, | 309 | 9.62k | predicate: P, | 310 | 9.62k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 9.62k | where | 312 | 9.62k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 9.62k | match self.iter().position(|c| predicate(*c)) { | 315 | 8.90k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 713 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 713 | self.take_from(self.len()), | 322 | 713 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 9.62k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 7.79k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 7.79k | &self, | 309 | 7.79k | predicate: P, | 310 | 7.79k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 7.79k | where | 312 | 7.79k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 7.79k | match self.iter().position(|c| predicate(*c)) { | 315 | 7.10k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 687 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 687 | self.take_from(self.len()), | 322 | 687 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 7.79k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 56.3k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 56.3k | &self, | 309 | 56.3k | predicate: P, | 310 | 56.3k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 56.3k | where | 312 | 56.3k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 56.3k | match self.iter().position(|c| predicate(*c)) { | 315 | 55.0k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.27k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 1.27k | self.take_from(self.len()), | 322 | 1.27k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 56.3k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 29.3M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 29.3M | &self, | 309 | 29.3M | predicate: P, | 310 | 29.3M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 29.3M | where | 312 | 29.3M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 29.3M | match self.iter().position(|c| predicate(*c)) { | 315 | 20.1M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 9.14M | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 9.14M | self.take_from(self.len()), | 322 | 9.14M | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 29.3M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 7.88k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 7.88k | &self, | 309 | 7.88k | predicate: P, | 310 | 7.88k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 7.88k | where | 312 | 7.88k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 7.88k | match self.iter().position(|c| predicate(*c)) { | 315 | 4.82k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 3.06k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 3.06k | self.take_from(self.len()), | 322 | 3.06k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 7.88k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 10.1M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 10.1M | &self, | 309 | 10.1M | predicate: P, | 310 | 10.1M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 10.1M | where | 312 | 10.1M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 10.1M | match self.iter().position(|c| predicate(*c)) { | 315 | 9.76M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 359k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 359k | self.take_from(self.len()), | 322 | 359k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 10.1M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <nom::bytes::SplitPosition<suricata::mime::mime::mime_parse_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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 9.66M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 9.66M | &self, | 309 | 9.66M | predicate: P, | 310 | 9.66M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 9.66M | where | 312 | 9.66M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 9.66M | match self.iter().position(|c| predicate(*c)) { | 315 | 7.76M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.89M | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 1.89M | self.take_from(self.len()), | 322 | 1.89M | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 9.66M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 435k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 435k | &self, | 309 | 435k | predicate: P, | 310 | 435k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 435k | where | 312 | 435k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 435k | match self.iter().position(|c| predicate(*c)) { | 315 | 431k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 4.13k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 4.13k | self.take_from(self.len()), | 322 | 4.13k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 435k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 52.7k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 52.7k | &self, | 309 | 52.7k | predicate: P, | 310 | 52.7k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 52.7k | where | 312 | 52.7k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 52.7k | match self.iter().position(|c| predicate(*c)) { | 315 | 52.7k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 0 | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 52.7k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 1.07M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 1.07M | &self, | 309 | 1.07M | predicate: P, | 310 | 1.07M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 1.07M | where | 312 | 1.07M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 1.07M | match self.iter().position(|c| predicate(*c)) { | 315 | 747k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 327k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 327k | self.take_from(self.len()), | 322 | 327k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 1.07M | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&[u8]>><&[u8] as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 786k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 786k | &self, | 309 | 786k | predicate: P, | 310 | 786k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 786k | where | 312 | 786k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 786k | match self.iter().position(|c| predicate(*c)) { | 315 | 519k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 266k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 266k | self.take_from(self.len()), | 322 | 266k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 786k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 5.91M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 5.91M | &self, | 309 | 5.91M | predicate: P, | 310 | 5.91M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 5.91M | where | 312 | 5.91M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 5.91M | match self.iter().position(|c| predicate(*c)) { | 315 | 1.99M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 3.91M | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 3.91M | self.take_from(self.len()), | 322 | 3.91M | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 5.91M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 3.42M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 3.42M | &self, | 309 | 3.42M | predicate: P, | 310 | 3.42M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 3.42M | where | 312 | 3.42M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 3.42M | match self.iter().position(|c| predicate(*c)) { | 315 | 2.78M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 643k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 643k | self.take_from(self.len()), | 322 | 643k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 3.42M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 131k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 131k | &self, | 309 | 131k | predicate: P, | 310 | 131k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 131k | where | 312 | 131k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 131k | match self.iter().position(|c| predicate(*c)) { | 315 | 117k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 14.4k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 14.4k | self.take_from(self.len()), | 322 | 14.4k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 131k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 58.9k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 58.9k | &self, | 309 | 58.9k | predicate: P, | 310 | 58.9k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 58.9k | where | 312 | 58.9k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 58.9k | match self.iter().position(|c| predicate(*c)) { | 315 | 54.9k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 3.99k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 3.99k | self.take_from(self.len()), | 322 | 3.99k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 58.9k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 6.95M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 6.95M | &self, | 309 | 6.95M | predicate: P, | 310 | 6.95M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 6.95M | where | 312 | 6.95M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 6.95M | match self.iter().position(|c| predicate(*c)) { | 315 | 5.66M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.28M | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 1.28M | self.take_from(self.len()), | 322 | 1.28M | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 6.95M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 42.5k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 42.5k | &self, | 309 | 42.5k | predicate: P, | 310 | 42.5k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 42.5k | where | 312 | 42.5k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 42.5k | match self.iter().position(|c| predicate(*c)) { | 315 | 32.1k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 10.3k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 10.3k | self.take_from(self.len()), | 322 | 10.3k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 42.5k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 23.8k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 23.8k | &self, | 309 | 23.8k | predicate: P, | 310 | 23.8k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 23.8k | where | 312 | 23.8k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 23.8k | match self.iter().position(|c| predicate(*c)) { | 315 | 1.30k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 22.5k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 22.5k | self.take_from(self.len()), | 322 | 22.5k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 23.8k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 347k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 347k | &self, | 309 | 347k | predicate: P, | 310 | 347k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 347k | where | 312 | 347k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 347k | match self.iter().position(|c| predicate(*c)) { | 315 | 332k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 15.0k | if OM::Incomplete::is_streaming() { | 318 | 0 | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 15.0k | self.take_from(self.len()), | 322 | 15.0k | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 347k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 5.79M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 5.79M | &self, | 309 | 5.79M | predicate: P, | 310 | 5.79M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 5.79M | where | 312 | 5.79M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 5.79M | match self.iter().position(|c| predicate(*c)) { | 315 | 4.07M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 1.72M | if OM::Incomplete::is_streaming() { | 318 | 1.72M | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 5.79M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 9.18M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 9.18M | &self, | 309 | 9.18M | predicate: P, | 310 | 9.18M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 9.18M | where | 312 | 9.18M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 9.18M | match self.iter().position(|c| predicate(*c)) { | 315 | 8.96M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 220k | if OM::Incomplete::is_streaming() { | 318 | 220k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 9.18M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 10.8M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 10.8M | &self, | 309 | 10.8M | predicate: P, | 310 | 10.8M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 10.8M | where | 312 | 10.8M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 10.8M | match self.iter().position(|c| predicate(*c)) { | 315 | 10.0M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 738k | if OM::Incomplete::is_streaming() { | 318 | 738k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 10.8M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 2.51M | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 2.51M | &self, | 309 | 2.51M | predicate: P, | 310 | 2.51M | ) -> crate::PResult<OM, Self, Self, E> | 311 | 2.51M | where | 312 | 2.51M | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 2.51M | match self.iter().position(|c| predicate(*c)) { | 315 | 2.13M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 376k | if OM::Incomplete::is_streaming() { | 318 | 376k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 2.51M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 307 | 24.9k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 24.9k | &self, | 309 | 24.9k | predicate: P, | 310 | 24.9k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 24.9k | where | 312 | 24.9k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 24.9k | match self.iter().position(|c| predicate(*c)) { | 315 | 285 | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 24.6k | if OM::Incomplete::is_streaming() { | 318 | 24.6k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 24.9k | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode::<_, _, _> <&[u8] as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, (&[u8], nom::error::ErrorKind)>Line | Count | Source | 307 | 25.5k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 308 | 25.5k | &self, | 309 | 25.5k | predicate: P, | 310 | 25.5k | ) -> crate::PResult<OM, Self, Self, E> | 311 | 25.5k | where | 312 | 25.5k | P: Fn(Self::Item) -> bool, | 313 | | { | 314 | 25.5k | match self.iter().position(|c| predicate(*c)) { | 315 | 10.8k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 316 | | None => { | 317 | 14.6k | if OM::Incomplete::is_streaming() { | 318 | 14.6k | Err(Err::Incomplete(Needed::new(1))) | 319 | | } else { | 320 | | Ok(( | 321 | 0 | self.take_from(self.len()), | 322 | 0 | OM::Output::bind(|| self.take(self.len())), | 323 | | )) | 324 | | } | 325 | | } | 326 | | } | 327 | 25.5k | } |
|
328 | | |
329 | | /// mode version of split_at_position |
330 | | #[inline(always)] |
331 | 4.82M | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( |
332 | 4.82M | &self, |
333 | 4.82M | predicate: P, |
334 | 4.82M | e: ErrorKind, |
335 | 4.82M | ) -> crate::PResult<OM, Self, Self, E> |
336 | 4.82M | where |
337 | 4.82M | P: Fn(Self::Item) -> bool, |
338 | | { |
339 | 86.8M | match self.iter().position(|c| predicate(*c)) {<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 7.64M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 32.2M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 7.73M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 12.3M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 17.6k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 395k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 3.56k | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 2.33M | match self.iter().position(|c| predicate(*c)) { |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#0}Line | Count | Source | 339 | 24.1M | match self.iter().position(|c| predicate(*c)) { |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#0} |
340 | 87.6k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 116 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 4.44k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 53 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 3.83k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 293 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 2.08k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 46.6k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#1}Line | Count | Source | 340 | 30.2k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#1} |
341 | 4.22M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 1.54M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 1.53M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 925k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 4.06k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 6.59k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 29.8k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 78 | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 20.9k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#2}Line | Count | Source | 341 | 154k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#2} |
342 | | None => { |
343 | 519k | if OM::Incomplete::is_streaming() { |
344 | 7.59k | Err(Err::Incomplete(Needed::new(1))) |
345 | 511k | } else if self.is_empty() { |
346 | 88.3k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#3}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#3}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#3}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#3}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#3}<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#3}Line | Count | Source | 346 | 34 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#3}Line | Count | Source | 346 | 3.99k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#3}<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#3}Line | Count | Source | 346 | 84.2k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#3} |
347 | | } else { |
348 | | Ok(( |
349 | 423k | self.take_from(self.len()), |
350 | 423k | OM::Output::bind(|| self.take(self.len())), Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#4}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#4}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#4}Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#4}<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#4}Line | Count | Source | 350 | 52 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#4}Line | Count | Source | 350 | 66 | OM::Output::bind(|| self.take(self.len())), |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#4}Line | Count | Source | 350 | 99 | OM::Output::bind(|| self.take(self.len())), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>::{closure#4}<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>::{closure#4}Line | Count | Source | 350 | 423k | OM::Output::bind(|| self.take(self.len())), |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#4} |
351 | | )) |
352 | | } |
353 | | } |
354 | | } |
355 | 4.82M | } <&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 1.54M | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 1.54M | &self, | 333 | 1.54M | predicate: P, | 334 | 1.54M | e: ErrorKind, | 335 | 1.54M | ) -> crate::PResult<OM, Self, Self, E> | 336 | 1.54M | where | 337 | 1.54M | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 1.54M | match self.iter().position(|c| predicate(*c)) { | 340 | 116 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 1.54M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 486 | if OM::Incomplete::is_streaming() { | 344 | 486 | Err(Err::Incomplete(Needed::new(1))) | 345 | 0 | } else if self.is_empty() { | 346 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 0 | self.take_from(self.len()), | 350 | 0 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 1.54M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 1.53M | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 1.53M | &self, | 333 | 1.53M | predicate: P, | 334 | 1.53M | e: ErrorKind, | 335 | 1.53M | ) -> crate::PResult<OM, Self, Self, E> | 336 | 1.53M | where | 337 | 1.53M | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 1.53M | match self.iter().position(|c| predicate(*c)) { | 340 | 0 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 1.53M | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 0 | if OM::Incomplete::is_streaming() { | 344 | 0 | Err(Err::Incomplete(Needed::new(1))) | 345 | 0 | } else if self.is_empty() { | 346 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 0 | self.take_from(self.len()), | 350 | 0 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 1.53M | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 930k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 930k | &self, | 333 | 930k | predicate: P, | 334 | 930k | e: ErrorKind, | 335 | 930k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 930k | where | 337 | 930k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 930k | match self.iter().position(|c| predicate(*c)) { | 340 | 4.44k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 925k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 789 | if OM::Incomplete::is_streaming() { | 344 | 789 | Err(Err::Incomplete(Needed::new(1))) | 345 | 0 | } else if self.is_empty() { | 346 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 0 | self.take_from(self.len()), | 350 | 0 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 930k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 7.09k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 7.09k | &self, | 333 | 7.09k | predicate: P, | 334 | 7.09k | e: ErrorKind, | 335 | 7.09k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 7.09k | where | 337 | 7.09k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 7.09k | match self.iter().position(|c| predicate(*c)) { | 340 | 53 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 4.06k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 2.97k | if OM::Incomplete::is_streaming() { | 344 | 2.97k | Err(Err::Incomplete(Needed::new(1))) | 345 | 0 | } else if self.is_empty() { | 346 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 0 | self.take_from(self.len()), | 350 | 0 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 7.09k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 10.4k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 10.4k | &self, | 333 | 10.4k | predicate: P, | 334 | 10.4k | e: ErrorKind, | 335 | 10.4k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 10.4k | where | 337 | 10.4k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 10.4k | match self.iter().position(|c| predicate(*c)) { | 340 | 3.83k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 6.59k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 52 | if OM::Incomplete::is_streaming() { | 344 | 0 | Err(Err::Incomplete(Needed::new(1))) | 345 | 52 | } else if self.is_empty() { | 346 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 52 | self.take_from(self.len()), | 350 | 52 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 10.4k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 30.2k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 30.2k | &self, | 333 | 30.2k | predicate: P, | 334 | 30.2k | e: ErrorKind, | 335 | 30.2k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 30.2k | where | 337 | 30.2k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 30.2k | match self.iter().position(|c| predicate(*c)) { | 340 | 293 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 29.8k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 100 | if OM::Incomplete::is_streaming() { | 344 | 0 | Err(Err::Incomplete(Needed::new(1))) | 345 | 100 | } else if self.is_empty() { | 346 | 34 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 66 | self.take_from(self.len()), | 350 | 66 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 30.2k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 6.25k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 6.25k | &self, | 333 | 6.25k | predicate: P, | 334 | 6.25k | e: ErrorKind, | 335 | 6.25k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 6.25k | where | 337 | 6.25k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 6.25k | match self.iter().position(|c| predicate(*c)) { | 340 | 2.08k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 78 | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 4.09k | if OM::Incomplete::is_streaming() { | 344 | 0 | Err(Err::Incomplete(Needed::new(1))) | 345 | 4.09k | } else if self.is_empty() { | 346 | 3.99k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 99 | self.take_from(self.len()), | 350 | 99 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 6.25k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Streaming>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 70.9k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 70.9k | &self, | 333 | 70.9k | predicate: P, | 334 | 70.9k | e: ErrorKind, | 335 | 70.9k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 70.9k | where | 337 | 70.9k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 70.9k | match self.iter().position(|c| predicate(*c)) { | 340 | 46.6k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 20.9k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 3.33k | if OM::Incomplete::is_streaming() { | 344 | 3.33k | Err(Err::Incomplete(Needed::new(1))) | 345 | 0 | } else if self.is_empty() { | 346 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 0 | self.take_from(self.len()), | 350 | 0 | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 70.9k | } |
<&[u8] as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&[u8]>>Line | Count | Source | 331 | 692k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 332 | 692k | &self, | 333 | 692k | predicate: P, | 334 | 692k | e: ErrorKind, | 335 | 692k | ) -> crate::PResult<OM, Self, Self, E> | 336 | 692k | where | 337 | 692k | P: Fn(Self::Item) -> bool, | 338 | | { | 339 | 692k | match self.iter().position(|c| predicate(*c)) { | 340 | 30.2k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 341 | 154k | Some(n) => Ok((self.take_from(n), OM::Output::bind(|| self.take(n)))), | 342 | | None => { | 343 | 507k | if OM::Incomplete::is_streaming() { | 344 | 0 | Err(Err::Incomplete(Needed::new(1))) | 345 | 507k | } else if self.is_empty() { | 346 | 84.2k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 347 | | } else { | 348 | | Ok(( | 349 | 423k | self.take_from(self.len()), | 350 | 423k | OM::Output::bind(|| self.take(self.len())), | 351 | | )) | 352 | | } | 353 | | } | 354 | | } | 355 | 692k | } |
Unexecuted instantiation: <&[u8] as nom::traits::Input>::split_at_position_mode1::<_, _, _> |
356 | | } |
357 | | |
358 | | impl<'a> Input for &'a str { |
359 | | type Item = char; |
360 | | type Iter = Chars<'a>; |
361 | | type IterIndices = CharIndices<'a>; |
362 | | |
363 | 136M | fn input_len(&self) -> usize { |
364 | 136M | self.len() |
365 | 136M | } |
366 | | |
367 | | #[inline] |
368 | 560k | fn take(&self, index: usize) -> Self { |
369 | 560k | &self[..index] |
370 | 560k | } |
371 | | |
372 | | #[inline] |
373 | 684k | fn take_from(&self, index: usize) -> Self { |
374 | 684k | &self[index..] |
375 | 684k | } |
376 | | |
377 | | // return byte index |
378 | | #[inline] |
379 | 75 | fn take_split(&self, index: usize) -> (Self, Self) { |
380 | 75 | let (prefix, suffix) = self.split_at(index); |
381 | 75 | (suffix, prefix) |
382 | 75 | } |
383 | | |
384 | 0 | fn position<P>(&self, predicate: P) -> Option<usize> |
385 | 0 | where |
386 | 0 | P: Fn(Self::Item) -> bool, |
387 | | { |
388 | 0 | self.find(predicate) |
389 | 0 | } Unexecuted instantiation: <&str as nom::traits::Input>::position::<nom::character::complete::not_line_ending<&str, nom::error::Error<&str>>::{closure#0}>Unexecuted instantiation: <&str as nom::traits::Input>::position::<_> |
390 | | |
391 | | #[inline] |
392 | 403k | fn iter_elements(&self) -> Self::Iter { |
393 | 403k | self.chars() |
394 | 403k | } |
395 | | |
396 | | #[inline] |
397 | 0 | fn iter_indices(&self) -> Self::IterIndices { |
398 | 0 | self.char_indices() |
399 | 0 | } |
400 | | |
401 | | #[inline] |
402 | 41.2k | fn slice_index(&self, count: usize) -> Result<usize, Needed> { |
403 | 41.2k | let mut cnt = 0; |
404 | 77.7k | for (index, _) in self.char_indices() { |
405 | 77.7k | if cnt == count { |
406 | 36.4k | return Ok(index); |
407 | 41.2k | } |
408 | 41.2k | cnt += 1; |
409 | | } |
410 | 4.81k | if cnt == count { |
411 | 4.81k | return Ok(self.len()); |
412 | 1 | } |
413 | 1 | Err(Needed::Unknown) |
414 | 41.2k | } |
415 | | |
416 | | #[inline(always)] |
417 | 0 | fn split_at_position<P, E: ParseError<Self>>(&self, predicate: P) -> IResult<Self, Self, E> |
418 | 0 | where |
419 | 0 | P: Fn(Self::Item) -> bool, |
420 | | { |
421 | 0 | match self.find(predicate) { |
422 | | // The position i is returned from str::find() which means it is within the bounds of the string |
423 | 0 | Some(i) => { |
424 | 0 | let (str1, str2) = self.split_at(i); |
425 | 0 | Ok((str2, str1)) |
426 | | } |
427 | 0 | None => Err(Err::Incomplete(Needed::new(1))), |
428 | | } |
429 | 0 | } |
430 | | |
431 | | #[inline(always)] |
432 | 0 | fn split_at_position1<P, E: ParseError<Self>>( |
433 | 0 | &self, |
434 | 0 | predicate: P, |
435 | 0 | e: ErrorKind, |
436 | 0 | ) -> IResult<Self, Self, E> |
437 | 0 | where |
438 | 0 | P: Fn(Self::Item) -> bool, |
439 | | { |
440 | 0 | match self.find(predicate) { |
441 | 0 | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), |
442 | | // The position i is returned from str::find() which means it is within the bounds of the string |
443 | 0 | Some(i) => { |
444 | 0 | let (str1, str2) = self.split_at(i); |
445 | 0 | Ok((str2, str1)) |
446 | | } |
447 | 0 | None => Err(Err::Incomplete(Needed::new(1))), |
448 | | } |
449 | 0 | } |
450 | | |
451 | | #[inline(always)] |
452 | 754k | fn split_at_position_complete<P, E: ParseError<Self>>( |
453 | 754k | &self, |
454 | 754k | predicate: P, |
455 | 754k | ) -> IResult<Self, Self, E> |
456 | 754k | where |
457 | 754k | P: Fn(Self::Item) -> bool, |
458 | | { |
459 | 754k | match self.find(predicate) { |
460 | | // The position i is returned from str::find() which means it is within the bounds of the string |
461 | 729k | Some(i) => { |
462 | 729k | let (str1, str2) = self.split_at(i); |
463 | 729k | Ok((str2, str1)) |
464 | | } |
465 | 25.3k | None => Ok(self.split_at(0)), |
466 | | } |
467 | 754k | } <&str as nom::traits::Input>::split_at_position_complete::<nom::character::complete::multispace0<&str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 452 | 205k | fn split_at_position_complete<P, E: ParseError<Self>>( | 453 | 205k | &self, | 454 | 205k | predicate: P, | 455 | 205k | ) -> IResult<Self, Self, E> | 456 | 205k | where | 457 | 205k | P: Fn(Self::Item) -> bool, | 458 | | { | 459 | 205k | match self.find(predicate) { | 460 | | // The position i is returned from str::find() which means it is within the bounds of the string | 461 | 189k | Some(i) => { | 462 | 189k | let (str1, str2) = self.split_at(i); | 463 | 189k | Ok((str2, str1)) | 464 | | } | 465 | 15.7k | None => Ok(self.split_at(0)), | 466 | | } | 467 | 205k | } |
<&str as nom::traits::Input>::split_at_position_complete::<nom::character::complete::multispace0<&str, suricata::detect::error::RuleParseError<&str>>::{closure#0}, suricata::detect::error::RuleParseError<&str>>Line | Count | Source | 452 | 531k | fn split_at_position_complete<P, E: ParseError<Self>>( | 453 | 531k | &self, | 454 | 531k | predicate: P, | 455 | 531k | ) -> IResult<Self, Self, E> | 456 | 531k | where | 457 | 531k | P: Fn(Self::Item) -> bool, | 458 | | { | 459 | 531k | match self.find(predicate) { | 460 | | // The position i is returned from str::find() which means it is within the bounds of the string | 461 | 530k | Some(i) => { | 462 | 530k | let (str1, str2) = self.split_at(i); | 463 | 530k | Ok((str2, str1)) | 464 | | } | 465 | 801 | None => Ok(self.split_at(0)), | 466 | | } | 467 | 531k | } |
<&str as nom::traits::Input>::split_at_position_complete::<nom::character::complete::alpha0<&str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 452 | 4.18k | fn split_at_position_complete<P, E: ParseError<Self>>( | 453 | 4.18k | &self, | 454 | 4.18k | predicate: P, | 455 | 4.18k | ) -> IResult<Self, Self, E> | 456 | 4.18k | where | 457 | 4.18k | P: Fn(Self::Item) -> bool, | 458 | | { | 459 | 4.18k | match self.find(predicate) { | 460 | | // The position i is returned from str::find() which means it is within the bounds of the string | 461 | 4.17k | Some(i) => { | 462 | 4.17k | let (str1, str2) = self.split_at(i); | 463 | 4.17k | Ok((str2, str1)) | 464 | | } | 465 | 5 | None => Ok(self.split_at(0)), | 466 | | } | 467 | 4.18k | } |
<&str as nom::traits::Input>::split_at_position_complete::<nom::character::complete::space0<&str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 452 | 14.3k | fn split_at_position_complete<P, E: ParseError<Self>>( | 453 | 14.3k | &self, | 454 | 14.3k | predicate: P, | 455 | 14.3k | ) -> IResult<Self, Self, E> | 456 | 14.3k | where | 457 | 14.3k | P: Fn(Self::Item) -> bool, | 458 | | { | 459 | 14.3k | match self.find(predicate) { | 460 | | // The position i is returned from str::find() which means it is within the bounds of the string | 461 | 5.52k | Some(i) => { | 462 | 5.52k | let (str1, str2) = self.split_at(i); | 463 | 5.52k | Ok((str2, str1)) | 464 | | } | 465 | 8.81k | None => Ok(self.split_at(0)), | 466 | | } | 467 | 14.3k | } |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_complete::<_, _> |
468 | | |
469 | | #[inline(always)] |
470 | 522k | fn split_at_position1_complete<P, E: ParseError<Self>>( |
471 | 522k | &self, |
472 | 522k | predicate: P, |
473 | 522k | e: ErrorKind, |
474 | 522k | ) -> IResult<Self, Self, E> |
475 | 522k | where |
476 | 522k | P: Fn(Self::Item) -> bool, |
477 | | { |
478 | 522k | match self.find(predicate) { |
479 | 231k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), |
480 | | // The position i is returned from str::find() which means it is within the bounds of the string |
481 | 51.5k | Some(i) => { |
482 | 51.5k | let (str1, str2) = self.split_at(i); |
483 | 51.5k | Ok((str2, str1)) |
484 | | } |
485 | | None => { |
486 | 239k | if self.is_empty() { |
487 | 6.55k | Err(Err::Error(E::from_error_kind(self, e))) |
488 | | } else { |
489 | | // the end of slice is a char boundary |
490 | 233k | let (str1, str2) = self.split_at(self.len()); |
491 | 233k | Ok((str2, str1)) |
492 | | } |
493 | | } |
494 | | } |
495 | 522k | } <&str as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::hex_digit1<&str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 470 | 5.93k | fn split_at_position1_complete<P, E: ParseError<Self>>( | 471 | 5.93k | &self, | 472 | 5.93k | predicate: P, | 473 | 5.93k | e: ErrorKind, | 474 | 5.93k | ) -> IResult<Self, Self, E> | 475 | 5.93k | where | 476 | 5.93k | P: Fn(Self::Item) -> bool, | 477 | | { | 478 | 5.93k | match self.find(predicate) { | 479 | 20 | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 480 | | // The position i is returned from str::find() which means it is within the bounds of the string | 481 | 207 | Some(i) => { | 482 | 207 | let (str1, str2) = self.split_at(i); | 483 | 207 | Ok((str2, str1)) | 484 | | } | 485 | | None => { | 486 | 5.70k | if self.is_empty() { | 487 | 16 | Err(Err::Error(E::from_error_kind(self, e))) | 488 | | } else { | 489 | | // the end of slice is a char boundary | 490 | 5.69k | let (str1, str2) = self.split_at(self.len()); | 491 | 5.69k | Ok((str2, str1)) | 492 | | } | 493 | | } | 494 | | } | 495 | 5.93k | } |
<&str as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::multispace1<&str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 470 | 2.94k | fn split_at_position1_complete<P, E: ParseError<Self>>( | 471 | 2.94k | &self, | 472 | 2.94k | predicate: P, | 473 | 2.94k | e: ErrorKind, | 474 | 2.94k | ) -> IResult<Self, Self, E> | 475 | 2.94k | where | 476 | 2.94k | P: Fn(Self::Item) -> bool, | 477 | | { | 478 | 2.94k | match self.find(predicate) { | 479 | 927 | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 480 | | // The position i is returned from str::find() which means it is within the bounds of the string | 481 | 1.60k | Some(i) => { | 482 | 1.60k | let (str1, str2) = self.split_at(i); | 483 | 1.60k | Ok((str2, str1)) | 484 | | } | 485 | | None => { | 486 | 420 | if self.is_empty() { | 487 | 392 | Err(Err::Error(E::from_error_kind(self, e))) | 488 | | } else { | 489 | | // the end of slice is a char boundary | 490 | 28 | let (str1, str2) = self.split_at(self.len()); | 491 | 28 | Ok((str2, str1)) | 492 | | } | 493 | | } | 494 | | } | 495 | 2.94k | } |
<&str as nom::traits::Input>::split_at_position1_complete::<nom::character::complete::digit1<&str, nom::error::Error<&str>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 470 | 513k | fn split_at_position1_complete<P, E: ParseError<Self>>( | 471 | 513k | &self, | 472 | 513k | predicate: P, | 473 | 513k | e: ErrorKind, | 474 | 513k | ) -> IResult<Self, Self, E> | 475 | 513k | where | 476 | 513k | P: Fn(Self::Item) -> bool, | 477 | | { | 478 | 513k | match self.find(predicate) { | 479 | 230k | Some(0) => Err(Err::Error(E::from_error_kind(self, e))), | 480 | | // The position i is returned from str::find() which means it is within the bounds of the string | 481 | 49.7k | Some(i) => { | 482 | 49.7k | let (str1, str2) = self.split_at(i); | 483 | 49.7k | Ok((str2, str1)) | 484 | | } | 485 | | None => { | 486 | 233k | if self.is_empty() { | 487 | 6.14k | Err(Err::Error(E::from_error_kind(self, e))) | 488 | | } else { | 489 | | // the end of slice is a char boundary | 490 | 227k | let (str1, str2) = self.split_at(self.len()); | 491 | 227k | Ok((str2, str1)) | 492 | | } | 493 | | } | 494 | | } | 495 | 513k | } |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position1_complete::<_, _> |
496 | | |
497 | | /// mode version of split_at_position |
498 | | #[inline(always)] |
499 | 432k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( |
500 | 432k | &self, |
501 | 432k | predicate: P, |
502 | 432k | ) -> crate::PResult<OM, Self, Self, E> |
503 | 432k | where |
504 | 432k | P: Fn(Self::Item) -> bool, |
505 | | { |
506 | 432k | match self.find(predicate) { |
507 | 253k | Some(n) => unsafe { |
508 | | // find() returns a byte index that is already in the slice at a char boundary |
509 | | Ok(( |
510 | 253k | self.get_unchecked(n..), |
511 | 253k | OM::Output::bind(|| self.get_unchecked(..n)), <&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 7.23k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 11.9k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 18 | OM::Output::bind(|| self.get_unchecked(..n)), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<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::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::error::Error<&str>>::{closure#0}<&str as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 8 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 2.44k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 3.14k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 6.10k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 2.06k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 26.4k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 4.84k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 10.9k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 134 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 1.15k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 110 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 2.57k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 61 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 1.58k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 275 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 146 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 697 | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 41.5k | OM::Output::bind(|| self.get_unchecked(..n)), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&str>>::{closure#0}<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 23.6k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 511 | 106k | OM::Output::bind(|| self.get_unchecked(..n)), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<_, _, _>::{closure#0} |
512 | | )) |
513 | | }, |
514 | | None => { |
515 | 179k | if OM::Incomplete::is_streaming() { |
516 | 0 | Err(Err::Incomplete(Needed::new(1))) |
517 | | } else { |
518 | | // the end of slice is a char boundary |
519 | | unsafe { |
520 | | Ok(( |
521 | 179k | self.get_unchecked(self.len()..), |
522 | 179k | OM::Output::bind(|| self.get_unchecked(..self.len())), <&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 4.21k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 10.2k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 120 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<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::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::error::Error<&str>>::{closure#1}<&str as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 104 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 25.0k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 37.7k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 40.7k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 17.2k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 8 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 10 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 7 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 5 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 9 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 9.92k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 1.81k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 9 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 3.37k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 2.45k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 1.61k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 406 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&str>>::{closure#1}<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 18.3k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 522 | 5.82k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<_, _, _>::{closure#1} |
523 | | )) |
524 | | } |
525 | | } |
526 | | } |
527 | | } |
528 | 432k | } <&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>Line | Count | Source | 499 | 11.4k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 11.4k | &self, | 501 | 11.4k | predicate: P, | 502 | 11.4k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 11.4k | where | 504 | 11.4k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 11.4k | match self.find(predicate) { | 507 | 7.23k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 7.23k | self.get_unchecked(n..), | 511 | 7.23k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 4.21k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 4.21k | self.get_unchecked(self.len()..), | 522 | 4.21k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 11.4k | } |
<&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>Line | Count | Source | 499 | 22.2k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 22.2k | &self, | 501 | 22.2k | predicate: P, | 502 | 22.2k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 22.2k | where | 504 | 22.2k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 22.2k | match self.find(predicate) { | 507 | 11.9k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 11.9k | self.get_unchecked(n..), | 511 | 11.9k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 10.2k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 10.2k | self.get_unchecked(self.len()..), | 522 | 10.2k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 22.2k | } |
<&str as nom::traits::Input>::split_at_position_mode::<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<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}, nom::error::Error<&str>>Line | Count | Source | 499 | 138 | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 138 | &self, | 501 | 138 | predicate: P, | 502 | 138 | ) -> crate::PResult<OM, Self, Self, E> | 503 | 138 | where | 504 | 138 | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 138 | match self.find(predicate) { | 507 | 18 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 18 | self.get_unchecked(n..), | 511 | 18 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 120 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 120 | self.get_unchecked(self.len()..), | 522 | 120 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 138 | } |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<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::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::error::Error<&str>><&str as nom::traits::Input>::split_at_position_mode::<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>>::{closure#0}, nom::error::Error<&str>>Line | Count | Source | 499 | 112 | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 112 | &self, | 501 | 112 | predicate: P, | 502 | 112 | ) -> crate::PResult<OM, Self, Self, E> | 503 | 112 | where | 504 | 112 | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 112 | match self.find(predicate) { | 507 | 8 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 8 | self.get_unchecked(n..), | 511 | 8 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 104 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 104 | self.get_unchecked(self.len()..), | 522 | 104 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 112 | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 27.5k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 27.5k | &self, | 501 | 27.5k | predicate: P, | 502 | 27.5k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 27.5k | where | 504 | 27.5k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 27.5k | match self.find(predicate) { | 507 | 2.44k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 2.44k | self.get_unchecked(n..), | 511 | 2.44k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 25.0k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 25.0k | self.get_unchecked(self.len()..), | 522 | 25.0k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 27.5k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 40.8k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 40.8k | &self, | 501 | 40.8k | predicate: P, | 502 | 40.8k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 40.8k | where | 504 | 40.8k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 40.8k | match self.find(predicate) { | 507 | 3.14k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 3.14k | self.get_unchecked(n..), | 511 | 3.14k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 37.7k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 37.7k | self.get_unchecked(self.len()..), | 522 | 37.7k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 40.8k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 46.8k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 46.8k | &self, | 501 | 46.8k | predicate: P, | 502 | 46.8k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 46.8k | where | 504 | 46.8k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 46.8k | match self.find(predicate) { | 507 | 6.10k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 6.10k | self.get_unchecked(n..), | 511 | 6.10k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 40.7k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 40.7k | self.get_unchecked(self.len()..), | 522 | 40.7k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 46.8k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 19.3k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 19.3k | &self, | 501 | 19.3k | predicate: P, | 502 | 19.3k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 19.3k | where | 504 | 19.3k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 19.3k | match self.find(predicate) { | 507 | 2.06k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 2.06k | self.get_unchecked(n..), | 511 | 2.06k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 17.2k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 17.2k | self.get_unchecked(self.len()..), | 522 | 17.2k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 19.3k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 26.4k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 26.4k | &self, | 501 | 26.4k | predicate: P, | 502 | 26.4k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 26.4k | where | 504 | 26.4k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 26.4k | match self.find(predicate) { | 507 | 26.4k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 26.4k | self.get_unchecked(n..), | 511 | 26.4k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 0 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 0 | self.get_unchecked(self.len()..), | 522 | 0 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 26.4k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 4.85k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 4.85k | &self, | 501 | 4.85k | predicate: P, | 502 | 4.85k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 4.85k | where | 504 | 4.85k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 4.85k | match self.find(predicate) { | 507 | 4.84k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 4.84k | self.get_unchecked(n..), | 511 | 4.84k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 8 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 8 | self.get_unchecked(self.len()..), | 522 | 8 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 4.85k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 11.0k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 11.0k | &self, | 501 | 11.0k | predicate: P, | 502 | 11.0k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 11.0k | where | 504 | 11.0k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 11.0k | match self.find(predicate) { | 507 | 10.9k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 10.9k | self.get_unchecked(n..), | 511 | 10.9k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 10 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 10 | self.get_unchecked(self.len()..), | 522 | 10 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 11.0k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 141 | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 141 | &self, | 501 | 141 | predicate: P, | 502 | 141 | ) -> crate::PResult<OM, Self, Self, E> | 503 | 141 | where | 504 | 141 | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 141 | match self.find(predicate) { | 507 | 134 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 134 | self.get_unchecked(n..), | 511 | 134 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 7 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 7 | self.get_unchecked(self.len()..), | 522 | 7 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 141 | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 1.16k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 1.16k | &self, | 501 | 1.16k | predicate: P, | 502 | 1.16k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 1.16k | where | 504 | 1.16k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 1.16k | match self.find(predicate) { | 507 | 1.15k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 1.15k | self.get_unchecked(n..), | 511 | 1.15k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 5 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 5 | self.get_unchecked(self.len()..), | 522 | 5 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 1.16k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 119 | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 119 | &self, | 501 | 119 | predicate: P, | 502 | 119 | ) -> crate::PResult<OM, Self, Self, E> | 503 | 119 | where | 504 | 119 | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 119 | match self.find(predicate) { | 507 | 110 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 110 | self.get_unchecked(n..), | 511 | 110 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 9 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 9 | self.get_unchecked(self.len()..), | 522 | 9 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 119 | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 12.4k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 12.4k | &self, | 501 | 12.4k | predicate: P, | 502 | 12.4k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 12.4k | where | 504 | 12.4k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 12.4k | match self.find(predicate) { | 507 | 2.57k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 2.57k | self.get_unchecked(n..), | 511 | 2.57k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 9.92k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 9.92k | self.get_unchecked(self.len()..), | 522 | 9.92k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 12.4k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 1.88k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 1.88k | &self, | 501 | 1.88k | predicate: P, | 502 | 1.88k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 1.88k | where | 504 | 1.88k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 1.88k | match self.find(predicate) { | 507 | 61 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 61 | self.get_unchecked(n..), | 511 | 61 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 1.81k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 1.81k | self.get_unchecked(self.len()..), | 522 | 1.81k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 1.88k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 1.59k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 1.59k | &self, | 501 | 1.59k | predicate: P, | 502 | 1.59k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 1.59k | where | 504 | 1.59k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 1.59k | match self.find(predicate) { | 507 | 1.58k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 1.58k | self.get_unchecked(n..), | 511 | 1.58k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 9 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 9 | self.get_unchecked(self.len()..), | 522 | 9 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 1.59k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 3.65k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 3.65k | &self, | 501 | 3.65k | predicate: P, | 502 | 3.65k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 3.65k | where | 504 | 3.65k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 3.65k | match self.find(predicate) { | 507 | 275 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 275 | self.get_unchecked(n..), | 511 | 275 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 3.37k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 3.37k | self.get_unchecked(self.len()..), | 522 | 3.37k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 3.65k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 2.60k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 2.60k | &self, | 501 | 2.60k | predicate: P, | 502 | 2.60k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 2.60k | where | 504 | 2.60k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 2.60k | match self.find(predicate) { | 507 | 146 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 146 | self.get_unchecked(n..), | 511 | 146 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 2.45k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 2.45k | self.get_unchecked(self.len()..), | 522 | 2.45k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 2.60k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 2.31k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 2.31k | &self, | 501 | 2.31k | predicate: P, | 502 | 2.31k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 2.31k | where | 504 | 2.31k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 2.31k | match self.find(predicate) { | 507 | 697 | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 697 | self.get_unchecked(n..), | 511 | 697 | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 1.61k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 1.61k | self.get_unchecked(self.len()..), | 522 | 1.61k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 2.31k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 41.9k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 41.9k | &self, | 501 | 41.9k | predicate: P, | 502 | 41.9k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 41.9k | where | 504 | 41.9k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 41.9k | match self.find(predicate) { | 507 | 41.5k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 41.5k | self.get_unchecked(n..), | 511 | 41.5k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 406 | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 406 | self.get_unchecked(self.len()..), | 522 | 406 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 41.9k | } |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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::error::Error<&str>><&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 41.9k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 41.9k | &self, | 501 | 41.9k | predicate: P, | 502 | 41.9k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 41.9k | where | 504 | 41.9k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 41.9k | match self.find(predicate) { | 507 | 23.6k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 23.6k | self.get_unchecked(n..), | 511 | 23.6k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 18.3k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 18.3k | self.get_unchecked(self.len()..), | 522 | 18.3k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 41.9k | } |
<&str as nom::traits::Input>::split_at_position_mode::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 499 | 112k | fn split_at_position_mode<OM: crate::OutputMode, P, E: ParseError<Self>>( | 500 | 112k | &self, | 501 | 112k | predicate: P, | 502 | 112k | ) -> crate::PResult<OM, Self, Self, E> | 503 | 112k | where | 504 | 112k | P: Fn(Self::Item) -> bool, | 505 | | { | 506 | 112k | match self.find(predicate) { | 507 | 106k | Some(n) => unsafe { | 508 | | // find() returns a byte index that is already in the slice at a char boundary | 509 | | Ok(( | 510 | 106k | self.get_unchecked(n..), | 511 | 106k | OM::Output::bind(|| self.get_unchecked(..n)), | 512 | | )) | 513 | | }, | 514 | | None => { | 515 | 5.82k | if OM::Incomplete::is_streaming() { | 516 | 0 | Err(Err::Incomplete(Needed::new(1))) | 517 | | } else { | 518 | | // the end of slice is a char boundary | 519 | | unsafe { | 520 | | Ok(( | 521 | 5.82k | self.get_unchecked(self.len()..), | 522 | 5.82k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 523 | | )) | 524 | | } | 525 | | } | 526 | | } | 527 | | } | 528 | 112k | } |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode::<_, _, _> |
529 | | |
530 | | /// mode version of split_at_position |
531 | | #[inline(always)] |
532 | 1.75M | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( |
533 | 1.75M | &self, |
534 | 1.75M | predicate: P, |
535 | 1.75M | e: ErrorKind, |
536 | 1.75M | ) -> crate::PResult<OM, Self, Self, E> |
537 | 1.75M | where |
538 | 1.75M | P: Fn(Self::Item) -> bool, |
539 | | { |
540 | 1.75M | match self.find(predicate) { |
541 | 851k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), <&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 541 | 50 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 541 | 850k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#0}Line | Count | Source | 541 | 75 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, suricata::detect::error::RuleParseError<&str>>::{closure#0}Line | Count | Source | 541 | 1.24k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#0} |
542 | 502k | Some(n) => unsafe { |
543 | | // find() returns a byte index that is already in the slice at a char boundary |
544 | | Ok(( |
545 | 502k | self.get_unchecked(n..), |
546 | 502k | OM::Output::bind(|| self.get_unchecked(..n)), <&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 546 | 35.3k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 546 | 52.5k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#1}Line | Count | Source | 546 | 2.71k | OM::Output::bind(|| self.get_unchecked(..n)), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, suricata::detect::error::RuleParseError<&str>>::{closure#1}Line | Count | Source | 546 | 411k | OM::Output::bind(|| self.get_unchecked(..n)), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#1} |
547 | | )) |
548 | | }, |
549 | | None => { |
550 | 395k | if OM::Incomplete::is_streaming() { |
551 | 0 | Err(Err::Incomplete(Needed::new(1))) |
552 | 395k | } else if self.is_empty() { |
553 | 117k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) <&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#2}Line | Count | Source | 553 | 2.38k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#2}Line | Count | Source | 553 | 114k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#2}<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, suricata::detect::error::RuleParseError<&str>>::{closure#2}Line | Count | Source | 553 | 801 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#2} |
554 | | } else { |
555 | | // the end of slice is a char boundary |
556 | | unsafe { |
557 | | Ok(( |
558 | 278k | self.get_unchecked(self.len()..), |
559 | 278k | OM::Output::bind(|| self.get_unchecked(..self.len())), <&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#3}Line | Count | Source | 559 | 2.53k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#3}Line | Count | Source | 559 | 437 | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>::{closure#3}Line | Count | Source | 559 | 4.02k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, suricata::detect::error::RuleParseError<&str>>::{closure#3}Line | Count | Source | 559 | 271k | OM::Output::bind(|| self.get_unchecked(..self.len())), |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode1::<_, _, _>::{closure#3} |
560 | | )) |
561 | | } |
562 | | } |
563 | | } |
564 | | } |
565 | 1.75M | } <&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 532 | 40.3k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 533 | 40.3k | &self, | 534 | 40.3k | predicate: P, | 535 | 40.3k | e: ErrorKind, | 536 | 40.3k | ) -> crate::PResult<OM, Self, Self, E> | 537 | 40.3k | where | 538 | 40.3k | P: Fn(Self::Item) -> bool, | 539 | | { | 540 | 40.3k | match self.find(predicate) { | 541 | 50 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 542 | 35.3k | Some(n) => unsafe { | 543 | | // find() returns a byte index that is already in the slice at a char boundary | 544 | | Ok(( | 545 | 35.3k | self.get_unchecked(n..), | 546 | 35.3k | OM::Output::bind(|| self.get_unchecked(..n)), | 547 | | )) | 548 | | }, | 549 | | None => { | 550 | 4.92k | if OM::Incomplete::is_streaming() { | 551 | 0 | Err(Err::Incomplete(Needed::new(1))) | 552 | 4.92k | } else if self.is_empty() { | 553 | 2.38k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 554 | | } else { | 555 | | // the end of slice is a char boundary | 556 | | unsafe { | 557 | | Ok(( | 558 | 2.53k | self.get_unchecked(self.len()..), | 559 | 2.53k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 560 | | )) | 561 | | } | 562 | | } | 563 | | } | 564 | | } | 565 | 40.3k | } |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 532 | 1.01M | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 533 | 1.01M | &self, | 534 | 1.01M | predicate: P, | 535 | 1.01M | e: ErrorKind, | 536 | 1.01M | ) -> crate::PResult<OM, Self, Self, E> | 537 | 1.01M | where | 538 | 1.01M | P: Fn(Self::Item) -> bool, | 539 | | { | 540 | 1.01M | match self.find(predicate) { | 541 | 850k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 542 | 52.5k | Some(n) => unsafe { | 543 | | // find() returns a byte index that is already in the slice at a char boundary | 544 | | Ok(( | 545 | 52.5k | self.get_unchecked(n..), | 546 | 52.5k | OM::Output::bind(|| self.get_unchecked(..n)), | 547 | | )) | 548 | | }, | 549 | | None => { | 550 | 114k | if OM::Incomplete::is_streaming() { | 551 | 0 | Err(Err::Incomplete(Needed::new(1))) | 552 | 114k | } else if self.is_empty() { | 553 | 114k | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 554 | | } else { | 555 | | // the end of slice is a char boundary | 556 | | unsafe { | 557 | | Ok(( | 558 | 437 | self.get_unchecked(self.len()..), | 559 | 437 | OM::Output::bind(|| self.get_unchecked(..self.len())), | 560 | | )) | 561 | | } | 562 | | } | 563 | | } | 564 | | } | 565 | 1.01M | } |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, nom::error::Error<&str>>Line | Count | Source | 532 | 6.82k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 533 | 6.82k | &self, | 534 | 6.82k | predicate: P, | 535 | 6.82k | e: ErrorKind, | 536 | 6.82k | ) -> crate::PResult<OM, Self, Self, E> | 537 | 6.82k | where | 538 | 6.82k | P: Fn(Self::Item) -> bool, | 539 | | { | 540 | 6.82k | match self.find(predicate) { | 541 | 75 | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 542 | 2.71k | Some(n) => unsafe { | 543 | | // find() returns a byte index that is already in the slice at a char boundary | 544 | | Ok(( | 545 | 2.71k | self.get_unchecked(n..), | 546 | 2.71k | OM::Output::bind(|| self.get_unchecked(..n)), | 547 | | )) | 548 | | }, | 549 | | None => { | 550 | 4.02k | if OM::Incomplete::is_streaming() { | 551 | 0 | Err(Err::Incomplete(Needed::new(1))) | 552 | 4.02k | } else if self.is_empty() { | 553 | 0 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 554 | | } else { | 555 | | // the end of slice is a char boundary | 556 | | unsafe { | 557 | | Ok(( | 558 | 4.02k | self.get_unchecked(self.len()..), | 559 | 4.02k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 560 | | )) | 561 | | } | 562 | | } | 563 | | } | 564 | | } | 565 | 6.82k | } |
<&str as nom::traits::Input>::split_at_position_mode1::<nom::internal::OutputM<nom::internal::Emit, nom::internal::Emit, nom::internal::Complete>, <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}, suricata::detect::error::RuleParseError<&str>>Line | Count | Source | 532 | 685k | fn split_at_position_mode1<OM: crate::OutputMode, P, E: ParseError<Self>>( | 533 | 685k | &self, | 534 | 685k | predicate: P, | 535 | 685k | e: ErrorKind, | 536 | 685k | ) -> crate::PResult<OM, Self, Self, E> | 537 | 685k | where | 538 | 685k | P: Fn(Self::Item) -> bool, | 539 | | { | 540 | 685k | match self.find(predicate) { | 541 | 1.24k | Some(0) => Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))), | 542 | 411k | Some(n) => unsafe { | 543 | | // find() returns a byte index that is already in the slice at a char boundary | 544 | | Ok(( | 545 | 411k | self.get_unchecked(n..), | 546 | 411k | OM::Output::bind(|| self.get_unchecked(..n)), | 547 | | )) | 548 | | }, | 549 | | None => { | 550 | 272k | if OM::Incomplete::is_streaming() { | 551 | 0 | Err(Err::Incomplete(Needed::new(1))) | 552 | 272k | } else if self.is_empty() { | 553 | 801 | Err(Err::Error(OM::Error::bind(|| E::from_error_kind(self, e)))) | 554 | | } else { | 555 | | // the end of slice is a char boundary | 556 | | unsafe { | 557 | | Ok(( | 558 | 271k | self.get_unchecked(self.len()..), | 559 | 271k | OM::Output::bind(|| self.get_unchecked(..self.len())), | 560 | | )) | 561 | | } | 562 | | } | 563 | | } | 564 | | } | 565 | 685k | } |
Unexecuted instantiation: <&str as nom::traits::Input>::split_at_position_mode1::<_, _, _> |
566 | | } |
567 | | |
568 | | /// Useful functions to calculate the offset between slices and show a hexdump of a slice |
569 | | pub trait Offset { |
570 | | /// Offset between the first byte of self and the first byte of the argument |
571 | | /// the argument must be a part of self, otherwise this can fail with arithmetic |
572 | | /// underflows as it compares byte offsets |
573 | | fn offset(&self, second: &Self) -> usize; |
574 | | } |
575 | | |
576 | | impl Offset for [u8] { |
577 | 0 | fn offset(&self, second: &Self) -> usize { |
578 | 0 | let fst = self.as_ptr(); |
579 | 0 | let snd = second.as_ptr(); |
580 | | |
581 | 0 | snd as usize - fst as usize |
582 | 0 | } |
583 | | } |
584 | | |
585 | | impl<'a> Offset for &'a [u8] { |
586 | 0 | fn offset(&self, second: &Self) -> usize { |
587 | 0 | let fst = self.as_ptr(); |
588 | 0 | let snd = second.as_ptr(); |
589 | | |
590 | 0 | snd as usize - fst as usize |
591 | 0 | } |
592 | | } |
593 | | |
594 | | impl Offset for str { |
595 | 0 | fn offset(&self, second: &Self) -> usize { |
596 | 0 | let fst = self.as_ptr(); |
597 | 0 | let snd = second.as_ptr(); |
598 | | |
599 | 0 | snd as usize - fst as usize |
600 | 0 | } |
601 | | } |
602 | | |
603 | | impl<'a> Offset for &'a str { |
604 | 5.25k | fn offset(&self, second: &Self) -> usize { |
605 | 5.25k | let fst = self.as_ptr(); |
606 | 5.25k | let snd = second.as_ptr(); |
607 | | |
608 | 5.25k | snd as usize - fst as usize |
609 | 5.25k | } |
610 | | } |
611 | | |
612 | | /// Helper trait for types that can be viewed as a byte slice |
613 | | pub trait AsBytes { |
614 | | /// Casts the input type to a byte slice |
615 | | fn as_bytes(&self) -> &[u8]; |
616 | | } |
617 | | |
618 | | impl<'a> AsBytes for &'a str { |
619 | | #[inline(always)] |
620 | 38.9M | fn as_bytes(&self) -> &[u8] { |
621 | 38.9M | (*self).as_bytes() |
622 | 38.9M | } |
623 | | } |
624 | | |
625 | | impl AsBytes for str { |
626 | | #[inline(always)] |
627 | 154M | fn as_bytes(&self) -> &[u8] { |
628 | 154M | self.as_ref() |
629 | 154M | } |
630 | | } |
631 | | |
632 | | impl<'a> AsBytes for &'a [u8] { |
633 | | #[inline(always)] |
634 | 0 | fn as_bytes(&self) -> &[u8] { |
635 | 0 | self |
636 | 0 | } |
637 | | } |
638 | | |
639 | | impl AsBytes for [u8] { |
640 | | #[inline(always)] |
641 | 0 | fn as_bytes(&self) -> &[u8] { |
642 | 0 | self |
643 | 0 | } |
644 | | } |
645 | | |
646 | | impl<'a, const N: usize> AsBytes for &'a [u8; N] { |
647 | | #[inline(always)] |
648 | 0 | fn as_bytes(&self) -> &[u8] { |
649 | 0 | self.as_slice() |
650 | 0 | } |
651 | | } |
652 | | |
653 | | impl<const N: usize> AsBytes for [u8; N] { |
654 | | #[inline(always)] |
655 | 0 | fn as_bytes(&self) -> &[u8] { |
656 | 0 | self |
657 | 0 | } |
658 | | } |
659 | | |
660 | | /// Transforms common types to a char for basic token parsing |
661 | | #[allow(clippy::len_without_is_empty)] |
662 | | pub trait AsChar: Copy { |
663 | | /// makes a char from self |
664 | | fn as_char(self) -> char; |
665 | | |
666 | | /// Tests that self is an alphabetic character |
667 | | /// |
668 | | /// Warning: for `&str` it recognizes alphabetic |
669 | | /// characters outside of the 52 ASCII letters |
670 | | fn is_alpha(self) -> bool; |
671 | | |
672 | | /// Tests that self is an alphabetic character |
673 | | /// or a decimal digit |
674 | | fn is_alphanum(self) -> bool; |
675 | | /// Tests that self is a decimal digit |
676 | | fn is_dec_digit(self) -> bool; |
677 | | /// Tests that self is an hex digit |
678 | | fn is_hex_digit(self) -> bool; |
679 | | /// Tests that self is an octal digit |
680 | | fn is_oct_digit(self) -> bool; |
681 | | /// Tests that self is a binary digit |
682 | | fn is_bin_digit(self) -> bool; |
683 | | /// Gets the len in bytes for self |
684 | | fn len(self) -> usize; |
685 | | /// Tests that self is ASCII space or tab |
686 | | fn is_space(self) -> bool; |
687 | | /// Tests if byte is ASCII newline: \n |
688 | | fn is_newline(self) -> bool; |
689 | | } |
690 | | |
691 | | impl AsChar for u8 { |
692 | | #[inline] |
693 | 88.4M | fn as_char(self) -> char { |
694 | 88.4M | self as char |
695 | 88.4M | } |
696 | | #[inline] |
697 | 97.6M | fn is_alpha(self) -> bool { |
698 | 97.6M | matches!(self, 0x41..=0x5A | 0x61..=0x7A) |
699 | 97.6M | } |
700 | | #[inline] |
701 | 90.8M | fn is_alphanum(self) -> bool { |
702 | 90.8M | self.is_alpha() || self.is_dec_digit() |
703 | 90.8M | } |
704 | | #[inline] |
705 | 69.5M | fn is_dec_digit(self) -> bool { |
706 | 69.5M | matches!(self, 0x30..=0x39) |
707 | 69.5M | } |
708 | | #[inline] |
709 | 0 | fn is_hex_digit(self) -> bool { |
710 | 0 | matches!(self, 0x30..=0x39 | 0x41..=0x46 | 0x61..=0x66) |
711 | 0 | } |
712 | | #[inline] |
713 | 0 | fn is_oct_digit(self) -> bool { |
714 | 0 | matches!(self, 0x30..=0x37) |
715 | 0 | } |
716 | | #[inline] |
717 | 0 | fn is_bin_digit(self) -> bool { |
718 | 0 | matches!(self, 0x30..=0x31) |
719 | 0 | } |
720 | | #[inline] |
721 | 6.04k | fn len(self) -> usize { |
722 | 6.04k | 1 |
723 | 6.04k | } |
724 | | #[inline] |
725 | 8.93M | fn is_space(self) -> bool { |
726 | 8.93M | self == b' ' || self == b'\t' |
727 | 8.93M | } |
728 | 0 | fn is_newline(self) -> bool { |
729 | 0 | self == b'\n' |
730 | 0 | } |
731 | | } |
732 | | impl<'a> AsChar for &'a u8 { |
733 | | #[inline] |
734 | 0 | fn as_char(self) -> char { |
735 | 0 | *self as char |
736 | 0 | } |
737 | | #[inline] |
738 | 0 | fn is_alpha(self) -> bool { |
739 | 0 | matches!(*self, 0x41..=0x5A | 0x61..=0x7A) |
740 | 0 | } |
741 | | #[inline] |
742 | 0 | fn is_alphanum(self) -> bool { |
743 | 0 | self.is_alpha() || self.is_dec_digit() |
744 | 0 | } |
745 | | #[inline] |
746 | 0 | fn is_dec_digit(self) -> bool { |
747 | 0 | matches!(*self, 0x30..=0x39) |
748 | 0 | } |
749 | | #[inline] |
750 | 0 | fn is_hex_digit(self) -> bool { |
751 | 0 | matches!(*self, 0x30..=0x39 | 0x41..=0x46 | 0x61..=0x66) |
752 | 0 | } |
753 | | #[inline] |
754 | 0 | fn is_oct_digit(self) -> bool { |
755 | 0 | matches!(*self, 0x30..=0x37) |
756 | 0 | } |
757 | | #[inline] |
758 | 0 | fn is_bin_digit(self) -> bool { |
759 | 0 | matches!(*self, 0x30..=0x31) |
760 | 0 | } |
761 | | #[inline] |
762 | 0 | fn len(self) -> usize { |
763 | 0 | 1 |
764 | 0 | } |
765 | | #[inline] |
766 | 0 | fn is_space(self) -> bool { |
767 | 0 | *self == b' ' || *self == b'\t' |
768 | 0 | } |
769 | 0 | fn is_newline(self) -> bool { |
770 | 0 | *self == b'\n' |
771 | 0 | } |
772 | | } |
773 | | |
774 | | impl AsChar for char { |
775 | | #[inline] |
776 | 1.36M | fn as_char(self) -> char { |
777 | 1.36M | self |
778 | 1.36M | } |
779 | | #[inline] |
780 | 56.8k | fn is_alpha(self) -> bool { |
781 | 56.8k | self.is_ascii_alphabetic() |
782 | 56.8k | } |
783 | | #[inline] |
784 | 0 | fn is_alphanum(self) -> bool { |
785 | 0 | self.is_alpha() || self.is_dec_digit() |
786 | 0 | } |
787 | | #[inline] |
788 | 927k | fn is_dec_digit(self) -> bool { |
789 | 927k | self.is_ascii_digit() |
790 | 927k | } |
791 | | #[inline] |
792 | 19.7k | fn is_hex_digit(self) -> bool { |
793 | 19.7k | self.is_ascii_hexdigit() |
794 | 19.7k | } |
795 | | #[inline] |
796 | 0 | fn is_oct_digit(self) -> bool { |
797 | 0 | self.is_digit(8) |
798 | 0 | } |
799 | | #[inline] |
800 | 0 | fn is_bin_digit(self) -> bool { |
801 | 0 | self.is_digit(2) |
802 | 0 | } |
803 | | #[inline] |
804 | 33.9k | fn len(self) -> usize { |
805 | 33.9k | self.len_utf8() |
806 | 33.9k | } |
807 | | #[inline] |
808 | 0 | fn is_space(self) -> bool { |
809 | 0 | self == ' ' || self == '\t' |
810 | 0 | } |
811 | 0 | fn is_newline(self) -> bool { |
812 | 0 | self == '\n' |
813 | 0 | } |
814 | | } |
815 | | |
816 | | impl<'a> AsChar for &'a char { |
817 | | #[inline] |
818 | 33.9M | fn as_char(self) -> char { |
819 | 33.9M | *self |
820 | 33.9M | } |
821 | | #[inline] |
822 | 0 | fn is_alpha(self) -> bool { |
823 | 0 | self.is_ascii_alphabetic() |
824 | 0 | } |
825 | | #[inline] |
826 | 0 | fn is_alphanum(self) -> bool { |
827 | 0 | self.is_alpha() || self.is_dec_digit() |
828 | 0 | } |
829 | | #[inline] |
830 | 0 | fn is_dec_digit(self) -> bool { |
831 | 0 | self.is_ascii_digit() |
832 | 0 | } |
833 | | #[inline] |
834 | 0 | fn is_hex_digit(self) -> bool { |
835 | 0 | self.is_ascii_hexdigit() |
836 | 0 | } |
837 | | #[inline] |
838 | 0 | fn is_oct_digit(self) -> bool { |
839 | 0 | self.is_digit(8) |
840 | 0 | } |
841 | | #[inline] |
842 | 0 | fn is_bin_digit(self) -> bool { |
843 | 0 | self.is_digit(2) |
844 | 0 | } |
845 | | #[inline] |
846 | 33.9M | fn len(self) -> usize { |
847 | 33.9M | self.len_utf8() |
848 | 33.9M | } |
849 | | #[inline] |
850 | 0 | fn is_space(self) -> bool { |
851 | 0 | *self == ' ' || *self == '\t' |
852 | 0 | } |
853 | 0 | fn is_newline(self) -> bool { |
854 | 0 | *self == '\n' |
855 | 0 | } |
856 | | } |
857 | | |
858 | | /// Indicates whether a comparison was successful, an error, or |
859 | | /// if more data was needed |
860 | | #[derive(Debug, Eq, PartialEq)] |
861 | | pub enum CompareResult { |
862 | | /// Comparison was successful |
863 | | Ok, |
864 | | /// We need more data to be sure |
865 | | Incomplete, |
866 | | /// Comparison failed |
867 | | Error, |
868 | | } |
869 | | |
870 | | /// Abstracts comparison operations |
871 | | pub trait Compare<T> { |
872 | | /// Compares self to another value for equality |
873 | | fn compare(&self, t: T) -> CompareResult; |
874 | | /// Compares self to another value for equality |
875 | | /// independently of the case. |
876 | | /// |
877 | | /// Warning: for `&str`, the comparison is done |
878 | | /// by lowercasing both strings and comparing |
879 | | /// the result. This is a temporary solution until |
880 | | /// a better one appears |
881 | | fn compare_no_case(&self, t: T) -> CompareResult; |
882 | | } |
883 | | |
884 | 11.1M | fn lowercase_byte(c: u8) -> u8 { |
885 | 11.1M | match c { |
886 | 9.84M | b'A'..=b'Z' => c - b'A' + b'a', |
887 | 6.58M | _ => c, |
888 | | } |
889 | 11.1M | } |
890 | | |
891 | | impl<'a, 'b> Compare<&'b [u8]> for &'a [u8] { |
892 | | #[inline(always)] |
893 | 157M | fn compare(&self, t: &'b [u8]) -> CompareResult { |
894 | 207M | let pos = self.iter().zip(t.iter()).position(|(a, b)| a != b); <&[u8] as nom::traits::Compare<&[u8]>>::compare::{closure#0}Line | Count | Source | 894 | 68.1M | let pos = self.iter().zip(t.iter()).position(|(a, b)| a != b); |
<&[u8] as nom::traits::Compare<&[u8]>>::compare::{closure#0}Line | Count | Source | 894 | 139M | let pos = self.iter().zip(t.iter()).position(|(a, b)| a != b); |
Unexecuted instantiation: <&[u8] as nom::traits::Compare<&[u8]>>::compare::{closure#0} |
895 | | |
896 | 157M | match pos { |
897 | 99.4M | Some(_) => CompareResult::Error, |
898 | | None => { |
899 | 57.6M | if self.len() >= t.len() { |
900 | 55.8M | CompareResult::Ok |
901 | | } else { |
902 | 1.80M | CompareResult::Incomplete |
903 | | } |
904 | | } |
905 | | } |
906 | 157M | } |
907 | | |
908 | | #[inline(always)] |
909 | 4.03M | fn compare_no_case(&self, t: &'b [u8]) -> CompareResult { |
910 | 4.03M | if self |
911 | 4.03M | .iter() |
912 | 4.03M | .zip(t) |
913 | 5.59M | .any(|(a, b)| lowercase_byte(*a) != lowercase_byte(*b)) <&[u8] as nom::traits::Compare<&[u8]>>::compare_no_case::{closure#0}Line | Count | Source | 913 | 5.59M | .any(|(a, b)| lowercase_byte(*a) != lowercase_byte(*b)) |
Unexecuted instantiation: <&[u8] as nom::traits::Compare<&[u8]>>::compare_no_case::{closure#0} |
914 | | { |
915 | 2.71M | CompareResult::Error |
916 | 1.32M | } else if self.len() < t.len() { |
917 | 651k | CompareResult::Incomplete |
918 | | } else { |
919 | 677k | CompareResult::Ok |
920 | | } |
921 | 4.03M | } |
922 | | } |
923 | | |
924 | | impl<'a, 'b> Compare<&'b str> for &'a [u8] { |
925 | | #[inline(always)] |
926 | 138M | fn compare(&self, t: &'b str) -> CompareResult { |
927 | 138M | self.compare(AsBytes::as_bytes(t)) |
928 | 138M | } |
929 | | #[inline(always)] |
930 | 4.03M | fn compare_no_case(&self, t: &'b str) -> CompareResult { |
931 | 4.03M | self.compare_no_case(AsBytes::as_bytes(t)) |
932 | 4.03M | } |
933 | | } |
934 | | |
935 | | impl<'a, 'b> Compare<&'b str> for &'a str { |
936 | | #[inline(always)] |
937 | 2.51M | fn compare(&self, t: &'b str) -> CompareResult { |
938 | 2.51M | self.as_bytes().compare(t.as_bytes()) |
939 | 2.51M | } |
940 | | |
941 | | //FIXME: this version is too simple and does not use the current locale |
942 | | #[inline(always)] |
943 | 1.55M | fn compare_no_case(&self, t: &'b str) -> CompareResult { |
944 | 1.55M | let pos = self |
945 | 1.55M | .chars() |
946 | 1.55M | .zip(t.chars()) |
947 | 1.55M | .position(|(a, b)| a.to_lowercase().ne(b.to_lowercase())); <&str as nom::traits::Compare<&str>>::compare_no_case::{closure#0}Line | Count | Source | 947 | 281k | .position(|(a, b)| a.to_lowercase().ne(b.to_lowercase())); |
Unexecuted instantiation: <&str as nom::traits::Compare<&str>>::compare_no_case::{closure#0} |
948 | | |
949 | 1.55M | match pos { |
950 | 264k | Some(_) => CompareResult::Error, |
951 | | None => { |
952 | 1.28M | if self.len() >= t.len() { |
953 | 5.06k | CompareResult::Ok |
954 | | } else { |
955 | 1.28M | CompareResult::Incomplete |
956 | | } |
957 | | } |
958 | | } |
959 | 1.55M | } |
960 | | } |
961 | | |
962 | | impl<'a, 'b> Compare<&'b [u8]> for &'a str { |
963 | | #[inline(always)] |
964 | 8.85k | fn compare(&self, t: &'b [u8]) -> CompareResult { |
965 | 8.85k | AsBytes::as_bytes(self).compare(t) |
966 | 8.85k | } |
967 | | #[inline(always)] |
968 | 0 | fn compare_no_case(&self, t: &'b [u8]) -> CompareResult { |
969 | 0 | AsBytes::as_bytes(self).compare_no_case(t) |
970 | 0 | } |
971 | | } |
972 | | |
973 | | /// Look for a token in self |
974 | | pub trait FindToken<T> { |
975 | | /// Returns true if self contains the token |
976 | | fn find_token(&self, token: T) -> bool; |
977 | | } |
978 | | |
979 | | impl<'a> FindToken<u8> for &'a [u8] { |
980 | 36.4M | fn find_token(&self, token: u8) -> bool { |
981 | 36.4M | memchr::memchr(token, self).is_some() |
982 | 36.4M | } |
983 | | } |
984 | | |
985 | | impl<'a> FindToken<u8> for &'a str { |
986 | 36.4M | fn find_token(&self, token: u8) -> bool { |
987 | 36.4M | self.as_bytes().find_token(token) |
988 | 36.4M | } |
989 | | } |
990 | | |
991 | | impl<'a, 'b> FindToken<&'a u8> for &'b [u8] { |
992 | 0 | fn find_token(&self, token: &u8) -> bool { |
993 | 0 | self.find_token(*token) |
994 | 0 | } |
995 | | } |
996 | | |
997 | | impl<'a, 'b> FindToken<&'a u8> for &'b str { |
998 | 0 | fn find_token(&self, token: &u8) -> bool { |
999 | 0 | self.as_bytes().find_token(token) |
1000 | 0 | } |
1001 | | } |
1002 | | |
1003 | | impl<'a> FindToken<char> for &'a [u8] { |
1004 | 0 | fn find_token(&self, token: char) -> bool { |
1005 | 0 | self.iter().any(|i| *i == token as u8) |
1006 | 0 | } |
1007 | | } |
1008 | | |
1009 | | impl<'a> FindToken<char> for &'a str { |
1010 | 6.04M | fn find_token(&self, token: char) -> bool { |
1011 | 12.9M | self.chars().any(|i| i == token) |
1012 | 6.04M | } |
1013 | | } |
1014 | | |
1015 | | impl<'a> FindToken<char> for &'a [char] { |
1016 | 0 | fn find_token(&self, token: char) -> bool { |
1017 | 0 | self.iter().any(|i| *i == token) |
1018 | 0 | } |
1019 | | } |
1020 | | |
1021 | | impl<'a, 'b> FindToken<&'a char> for &'b [char] { |
1022 | 0 | fn find_token(&self, token: &char) -> bool { |
1023 | 0 | self.find_token(*token) |
1024 | 0 | } |
1025 | | } |
1026 | | |
1027 | | /// Look for a substring in self |
1028 | | pub trait FindSubstring<T> { |
1029 | | /// Returns the byte position of the substring if it is found |
1030 | | fn find_substring(&self, substr: T) -> Option<usize>; |
1031 | | } |
1032 | | |
1033 | | impl<'a, 'b> FindSubstring<&'b [u8]> for &'a [u8] { |
1034 | 21.9M | fn find_substring(&self, substr: &'b [u8]) -> Option<usize> { |
1035 | 21.9M | if substr.len() > self.len() { |
1036 | 93.0k | return None; |
1037 | 21.8M | } |
1038 | | |
1039 | 21.8M | let (&substr_first, substr_rest) = match substr.split_first() { |
1040 | 21.8M | Some(split) => split, |
1041 | | // an empty substring is found at position 0 |
1042 | | // This matches the behavior of str.find(""). |
1043 | 0 | None => return Some(0), |
1044 | | }; |
1045 | | |
1046 | 21.8M | if substr_rest.is_empty() { |
1047 | 20.7M | return memchr::memchr(substr_first, self); |
1048 | 1.06M | } |
1049 | | |
1050 | 1.06M | let mut offset = 0; |
1051 | 1.06M | let haystack = &self[..self.len() - substr_rest.len()]; |
1052 | | |
1053 | 7.32M | while let Some(position) = memchr::memchr(substr_first, &haystack[offset..]) { |
1054 | 6.92M | offset += position; |
1055 | 6.92M | let next_offset = offset + 1; |
1056 | 6.92M | if &self[next_offset..][..substr_rest.len()] == substr_rest { |
1057 | 665k | return Some(offset); |
1058 | 6.25M | } |
1059 | | |
1060 | 6.25M | offset = next_offset; |
1061 | | } |
1062 | | |
1063 | 401k | None |
1064 | 21.9M | } |
1065 | | } |
1066 | | |
1067 | | impl<'a, 'b> FindSubstring<&'b str> for &'a [u8] { |
1068 | 11.6M | fn find_substring(&self, substr: &'b str) -> Option<usize> { |
1069 | 11.6M | self.find_substring(AsBytes::as_bytes(substr)) |
1070 | 11.6M | } |
1071 | | } |
1072 | | |
1073 | | impl<'a, 'b> FindSubstring<&'b str> for &'a str { |
1074 | | //returns byte index |
1075 | 0 | fn find_substring(&self, substr: &'b str) -> Option<usize> { |
1076 | 0 | self.find(substr) |
1077 | 0 | } |
1078 | | } |
1079 | | |
1080 | | /// Used to integrate `str`'s `parse()` method |
1081 | | pub trait ParseTo<R> { |
1082 | | /// Succeeds if `parse()` succeeded. The byte slice implementation |
1083 | | /// will first convert it to a `&str`, then apply the `parse()` function |
1084 | | fn parse_to(&self) -> Option<R>; |
1085 | | } |
1086 | | |
1087 | | impl<'a, R: FromStr> ParseTo<R> for &'a [u8] { |
1088 | 0 | fn parse_to(&self) -> Option<R> { |
1089 | 0 | from_utf8(self).ok().and_then(|s| s.parse().ok()) |
1090 | 0 | } |
1091 | | } |
1092 | | |
1093 | | impl<'a, R: FromStr> ParseTo<R> for &'a str { |
1094 | 0 | fn parse_to(&self) -> Option<R> { |
1095 | 0 | self.parse().ok() |
1096 | 0 | } Unexecuted instantiation: <&str as nom::traits::ParseTo<f64>>::parse_to Unexecuted instantiation: <&str as nom::traits::ParseTo<_>>::parse_to |
1097 | | } |
1098 | | |
1099 | | impl<'a, const N: usize> Compare<[u8; N]> for &'a [u8] { |
1100 | | #[inline(always)] |
1101 | 0 | fn compare(&self, t: [u8; N]) -> CompareResult { |
1102 | 0 | self.compare(&t[..]) |
1103 | 0 | } |
1104 | | |
1105 | | #[inline(always)] |
1106 | 0 | fn compare_no_case(&self, t: [u8; N]) -> CompareResult { |
1107 | 0 | self.compare_no_case(&t[..]) |
1108 | 0 | } |
1109 | | } |
1110 | | |
1111 | | impl<'a, 'b, const N: usize> Compare<&'b [u8; N]> for &'a [u8] { |
1112 | | #[inline(always)] |
1113 | 0 | fn compare(&self, t: &'b [u8; N]) -> CompareResult { |
1114 | 0 | self.compare(&t[..]) |
1115 | 0 | } |
1116 | | |
1117 | | #[inline(always)] |
1118 | 0 | fn compare_no_case(&self, t: &'b [u8; N]) -> CompareResult { |
1119 | 0 | self.compare_no_case(&t[..]) |
1120 | 0 | } |
1121 | | } |
1122 | | |
1123 | | impl<const N: usize> FindToken<u8> for [u8; N] { |
1124 | 0 | fn find_token(&self, token: u8) -> bool { |
1125 | 0 | memchr::memchr(token, &self[..]).is_some() |
1126 | 0 | } |
1127 | | } |
1128 | | |
1129 | | impl<'a, const N: usize> FindToken<&'a u8> for [u8; N] { |
1130 | 0 | fn find_token(&self, token: &u8) -> bool { |
1131 | 0 | self.find_token(*token) |
1132 | 0 | } |
1133 | | } |
1134 | | |
1135 | | /// Abstracts something which can extend an `Extend`. |
1136 | | /// Used to build modified input slices in `escaped_transform` |
1137 | | pub trait ExtendInto { |
1138 | | /// The current input type is a sequence of that `Item` type. |
1139 | | /// |
1140 | | /// Example: `u8` for `&[u8]` or `char` for `&str` |
1141 | | type Item; |
1142 | | |
1143 | | /// The type that will be produced |
1144 | | type Extender; |
1145 | | |
1146 | | /// Create a new `Extend` of the correct type |
1147 | | fn new_builder(&self) -> Self::Extender; |
1148 | | /// Accumulate the input into an accumulator |
1149 | | fn extend_into(&self, acc: &mut Self::Extender); |
1150 | | } |
1151 | | |
1152 | | #[cfg(feature = "alloc")] |
1153 | | impl ExtendInto for [u8] { |
1154 | | type Item = u8; |
1155 | | type Extender = Vec<u8>; |
1156 | | |
1157 | | #[inline] |
1158 | 0 | fn new_builder(&self) -> Vec<u8> { |
1159 | 0 | Vec::new() |
1160 | 0 | } |
1161 | | #[inline] |
1162 | 0 | fn extend_into(&self, acc: &mut Vec<u8>) { |
1163 | 0 | acc.extend(self.iter().cloned()); |
1164 | 0 | } |
1165 | | } |
1166 | | |
1167 | | #[cfg(feature = "alloc")] |
1168 | | impl ExtendInto for &[u8] { |
1169 | | type Item = u8; |
1170 | | type Extender = Vec<u8>; |
1171 | | |
1172 | | #[inline] |
1173 | 0 | fn new_builder(&self) -> Vec<u8> { |
1174 | 0 | Vec::new() |
1175 | 0 | } |
1176 | | #[inline] |
1177 | 0 | fn extend_into(&self, acc: &mut Vec<u8>) { |
1178 | 0 | acc.extend_from_slice(self); |
1179 | 0 | } |
1180 | | } |
1181 | | |
1182 | | #[cfg(feature = "alloc")] |
1183 | | impl ExtendInto for str { |
1184 | | type Item = char; |
1185 | | type Extender = String; |
1186 | | |
1187 | | #[inline] |
1188 | 0 | fn new_builder(&self) -> String { |
1189 | 0 | String::new() |
1190 | 0 | } |
1191 | | #[inline] |
1192 | 0 | fn extend_into(&self, acc: &mut String) { |
1193 | 0 | acc.push_str(self); |
1194 | 0 | } |
1195 | | } |
1196 | | |
1197 | | #[cfg(feature = "alloc")] |
1198 | | impl ExtendInto for &str { |
1199 | | type Item = char; |
1200 | | type Extender = String; |
1201 | | |
1202 | | #[inline] |
1203 | 0 | fn new_builder(&self) -> String { |
1204 | 0 | String::new() |
1205 | 0 | } |
1206 | | #[inline] |
1207 | 0 | fn extend_into(&self, acc: &mut String) { |
1208 | 0 | acc.push_str(self); |
1209 | 0 | } |
1210 | | } |
1211 | | |
1212 | | #[cfg(feature = "alloc")] |
1213 | | impl ExtendInto for char { |
1214 | | type Item = char; |
1215 | | type Extender = String; |
1216 | | |
1217 | | #[inline] |
1218 | 0 | fn new_builder(&self) -> String { |
1219 | 0 | String::new() |
1220 | 0 | } |
1221 | | #[inline] |
1222 | 0 | fn extend_into(&self, acc: &mut String) { |
1223 | 0 | acc.push(*self); |
1224 | 0 | } |
1225 | | } |
1226 | | |
1227 | | /// Helper trait to convert numbers to usize. |
1228 | | /// |
1229 | | /// By default, usize implements `From<u8>` and `From<u16>` but not |
1230 | | /// `From<u32>` and `From<u64>` because that would be invalid on some |
1231 | | /// platforms. This trait implements the conversion for platforms |
1232 | | /// with 32 and 64 bits pointer platforms |
1233 | | pub trait ToUsize { |
1234 | | /// converts self to usize |
1235 | | fn to_usize(&self) -> usize; |
1236 | | } |
1237 | | |
1238 | | impl ToUsize for u8 { |
1239 | | #[inline] |
1240 | 240M | fn to_usize(&self) -> usize { |
1241 | 240M | *self as usize |
1242 | 240M | } |
1243 | | } |
1244 | | |
1245 | | impl ToUsize for u16 { |
1246 | | #[inline] |
1247 | 11.0M | fn to_usize(&self) -> usize { |
1248 | 11.0M | *self as usize |
1249 | 11.0M | } |
1250 | | } |
1251 | | |
1252 | | impl ToUsize for usize { |
1253 | | #[inline] |
1254 | 45.1M | fn to_usize(&self) -> usize { |
1255 | 45.1M | *self |
1256 | 45.1M | } |
1257 | | } |
1258 | | |
1259 | | #[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))] |
1260 | | impl ToUsize for u32 { |
1261 | | #[inline] |
1262 | 20.9M | fn to_usize(&self) -> usize { |
1263 | 20.9M | *self as usize |
1264 | 20.9M | } |
1265 | | } |
1266 | | |
1267 | | #[cfg(target_pointer_width = "64")] |
1268 | | impl ToUsize for u64 { |
1269 | | #[inline] |
1270 | 0 | fn to_usize(&self) -> usize { |
1271 | 0 | *self as usize |
1272 | 0 | } |
1273 | | } |
1274 | | |
1275 | | /// Equivalent From implementation to avoid orphan rules in bits parsers |
1276 | | pub trait ErrorConvert<E> { |
1277 | | /// Transform to another error type |
1278 | | fn convert(self) -> E; |
1279 | | } |
1280 | | |
1281 | | impl<I> ErrorConvert<(I, ErrorKind)> for ((I, usize), ErrorKind) { |
1282 | 0 | fn convert(self) -> (I, ErrorKind) { |
1283 | 0 | ((self.0).0, self.1) |
1284 | 0 | } |
1285 | | } |
1286 | | |
1287 | | impl<I> ErrorConvert<((I, usize), ErrorKind)> for (I, ErrorKind) { |
1288 | 0 | fn convert(self) -> ((I, usize), ErrorKind) { |
1289 | 0 | ((self.0, 0), self.1) |
1290 | 0 | } |
1291 | | } |
1292 | | |
1293 | | use crate::error; |
1294 | | impl<I> ErrorConvert<error::Error<I>> for error::Error<(I, usize)> { |
1295 | 3.09k | fn convert(self) -> error::Error<I> { |
1296 | 3.09k | error::Error { |
1297 | 3.09k | input: self.input.0, |
1298 | 3.09k | code: self.code, |
1299 | 3.09k | } |
1300 | 3.09k | } <nom::error::Error<(&[u8], usize)> as nom::traits::ErrorConvert<nom::error::Error<&[u8]>>>::convert Line | Count | Source | 1295 | 3.09k | fn convert(self) -> error::Error<I> { | 1296 | 3.09k | error::Error { | 1297 | 3.09k | input: self.input.0, | 1298 | 3.09k | code: self.code, | 1299 | 3.09k | } | 1300 | 3.09k | } |
Unexecuted instantiation: <nom::error::Error<(_, usize)> as nom::traits::ErrorConvert<nom::error::Error<_>>>::convert |
1301 | | } |
1302 | | |
1303 | | impl<I> ErrorConvert<error::Error<(I, usize)>> for error::Error<I> { |
1304 | 0 | fn convert(self) -> error::Error<(I, usize)> { |
1305 | 0 | error::Error { |
1306 | 0 | input: (self.input, 0), |
1307 | 0 | code: self.code, |
1308 | 0 | } |
1309 | 0 | } |
1310 | | } |
1311 | | |
1312 | | impl ErrorConvert<()> for () { |
1313 | 0 | fn convert(self) {} |
1314 | | } |
1315 | | |
1316 | | #[cfg(feature = "std")] |
1317 | | #[cfg_attr(feature = "docsrs", doc(cfg(feature = "std")))] |
1318 | | /// Helper trait to show a byte slice as a hex dump |
1319 | | pub trait HexDisplay { |
1320 | | /// Converts the value of `self` to a hex dump, returning the owned |
1321 | | /// `String`. |
1322 | | fn to_hex(&self, chunk_size: usize) -> String; |
1323 | | |
1324 | | /// Converts the value of `self` to a hex dump beginning at `from` address, returning the owned |
1325 | | /// `String`. |
1326 | | fn to_hex_from(&self, chunk_size: usize, from: usize) -> String; |
1327 | | } |
1328 | | |
1329 | | #[cfg(feature = "std")] |
1330 | | static CHARS: &[u8] = b"0123456789abcdef"; |
1331 | | |
1332 | | #[cfg(feature = "std")] |
1333 | | impl HexDisplay for [u8] { |
1334 | | #[allow(unused_variables)] |
1335 | 0 | fn to_hex(&self, chunk_size: usize) -> String { |
1336 | 0 | self.to_hex_from(chunk_size, 0) |
1337 | 0 | } |
1338 | | |
1339 | | #[allow(unused_variables)] |
1340 | 0 | fn to_hex_from(&self, chunk_size: usize, from: usize) -> String { |
1341 | 0 | let mut v = Vec::with_capacity(self.len() * 3); |
1342 | 0 | let mut i = from; |
1343 | 0 | for chunk in self.chunks(chunk_size) { |
1344 | 0 | let s = format!("{:08x}", i); |
1345 | 0 | for &ch in s.as_bytes().iter() { |
1346 | 0 | v.push(ch); |
1347 | 0 | } |
1348 | 0 | v.push(b'\t'); |
1349 | | |
1350 | 0 | i += chunk_size; |
1351 | | |
1352 | 0 | for &byte in chunk { |
1353 | 0 | v.push(CHARS[(byte >> 4) as usize]); |
1354 | 0 | v.push(CHARS[(byte & 0xf) as usize]); |
1355 | 0 | v.push(b' '); |
1356 | 0 | } |
1357 | 0 | if chunk_size > chunk.len() { |
1358 | 0 | for j in 0..(chunk_size - chunk.len()) { |
1359 | 0 | v.push(b' '); |
1360 | 0 | v.push(b' '); |
1361 | 0 | v.push(b' '); |
1362 | 0 | } |
1363 | 0 | } |
1364 | 0 | v.push(b'\t'); |
1365 | | |
1366 | 0 | for &byte in chunk { |
1367 | 0 | if matches!(byte, 32..=126 | 128..=255) { |
1368 | 0 | v.push(byte); |
1369 | 0 | } else { |
1370 | 0 | v.push(b'.'); |
1371 | 0 | } |
1372 | | } |
1373 | 0 | v.push(b'\n'); |
1374 | | } |
1375 | | |
1376 | 0 | String::from_utf8_lossy(&v[..]).into_owned() |
1377 | 0 | } |
1378 | | } |
1379 | | |
1380 | | #[cfg(feature = "std")] |
1381 | | impl HexDisplay for str { |
1382 | | #[allow(unused_variables)] |
1383 | 0 | fn to_hex(&self, chunk_size: usize) -> String { |
1384 | 0 | self.to_hex_from(chunk_size, 0) |
1385 | 0 | } |
1386 | | |
1387 | | #[allow(unused_variables)] |
1388 | 0 | fn to_hex_from(&self, chunk_size: usize, from: usize) -> String { |
1389 | 0 | self.as_bytes().to_hex_from(chunk_size, from) |
1390 | 0 | } |
1391 | | } |
1392 | | |
1393 | | /// A saturating iterator for usize. |
1394 | | pub struct SaturatingIterator { |
1395 | | count: usize, |
1396 | | } |
1397 | | |
1398 | | impl Iterator for SaturatingIterator { |
1399 | | type Item = usize; |
1400 | | |
1401 | 0 | fn next(&mut self) -> Option<Self::Item> { |
1402 | 0 | let old_count = self.count; |
1403 | 0 | self.count = self.count.saturating_add(1); |
1404 | 0 | Some(old_count) |
1405 | 0 | } |
1406 | | } |
1407 | | |
1408 | | /// Abstractions for range-like types. |
1409 | | pub trait NomRange<Idx> { |
1410 | | /// The saturating iterator type. |
1411 | | type Saturating: Iterator<Item = Idx>; |
1412 | | /// The bounded iterator type. |
1413 | | type Bounded: Iterator<Item = Idx>; |
1414 | | |
1415 | | /// `true` if `item` is contained in the range. |
1416 | | fn contains(&self, item: &Idx) -> bool; |
1417 | | |
1418 | | /// Returns the bounds of this range. |
1419 | | fn bounds(&self) -> (Bound<Idx>, Bound<Idx>); |
1420 | | |
1421 | | /// `true` if the range is inverted. |
1422 | | fn is_inverted(&self) -> bool; |
1423 | | |
1424 | | /// Creates a saturating iterator. |
1425 | | /// A saturating iterator counts the number of iterations starting from 0 up to the upper bound of this range. |
1426 | | /// If the upper bound is infinite the iterator saturates at the largest representable value of its type and |
1427 | | /// returns it for all further elements. |
1428 | | fn saturating_iter(&self) -> Self::Saturating; |
1429 | | |
1430 | | /// Creates a bounded iterator. |
1431 | | /// A bounded iterator counts the number of iterations starting from 0 up to the upper bound of this range. |
1432 | | /// If the upper bounds is infinite the iterator counts up until the amount of iterations has reached the |
1433 | | /// largest representable value of its type and then returns `None` for all further elements. |
1434 | | fn bounded_iter(&self) -> Self::Bounded; |
1435 | | } |
1436 | | |
1437 | | impl NomRange<usize> for Range<usize> { |
1438 | | type Saturating = Range<usize>; |
1439 | | type Bounded = Range<usize>; |
1440 | | |
1441 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1442 | 0 | (Bound::Included(self.start), Bound::Excluded(self.end)) |
1443 | 0 | } |
1444 | | |
1445 | 0 | fn contains(&self, item: &usize) -> bool { |
1446 | 0 | RangeBounds::contains(self, item) |
1447 | 0 | } |
1448 | | |
1449 | 0 | fn is_inverted(&self) -> bool { |
1450 | 0 | self.start >= self.end |
1451 | 0 | } |
1452 | | |
1453 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1454 | 0 | if self.end == 0 { |
1455 | 0 | Range::default() |
1456 | | } else { |
1457 | 0 | 0..self.end - 1 |
1458 | | } |
1459 | 0 | } |
1460 | | |
1461 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1462 | 0 | if self.end == 0 { |
1463 | 0 | Range::default() |
1464 | | } else { |
1465 | 0 | 0..self.end - 1 |
1466 | | } |
1467 | 0 | } |
1468 | | } |
1469 | | |
1470 | | impl NomRange<usize> for RangeInclusive<usize> { |
1471 | | type Saturating = Range<usize>; |
1472 | | type Bounded = Range<usize>; |
1473 | | |
1474 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1475 | 0 | (Bound::Included(*self.start()), Bound::Included(*self.end())) |
1476 | 0 | } |
1477 | | |
1478 | 0 | fn contains(&self, item: &usize) -> bool { |
1479 | 0 | RangeBounds::contains(self, item) |
1480 | 0 | } |
1481 | | |
1482 | 0 | fn is_inverted(&self) -> bool { |
1483 | 0 | !RangeInclusive::contains(self, self.start()) |
1484 | 0 | } |
1485 | | |
1486 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1487 | 0 | 0..*self.end() |
1488 | 0 | } |
1489 | | |
1490 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1491 | 0 | 0..*self.end() |
1492 | 0 | } |
1493 | | } |
1494 | | |
1495 | | impl NomRange<usize> for RangeFrom<usize> { |
1496 | | type Saturating = SaturatingIterator; |
1497 | | type Bounded = Range<usize>; |
1498 | | |
1499 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1500 | 0 | (Bound::Included(self.start), Bound::Unbounded) |
1501 | 0 | } |
1502 | | |
1503 | 0 | fn contains(&self, item: &usize) -> bool { |
1504 | 0 | RangeBounds::contains(self, item) |
1505 | 0 | } |
1506 | | |
1507 | 0 | fn is_inverted(&self) -> bool { |
1508 | 0 | false |
1509 | 0 | } |
1510 | | |
1511 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1512 | 0 | SaturatingIterator { count: 0 } |
1513 | 0 | } |
1514 | | |
1515 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1516 | 0 | 0..usize::MAX |
1517 | 0 | } |
1518 | | } |
1519 | | |
1520 | | impl NomRange<usize> for RangeTo<usize> { |
1521 | | type Saturating = Range<usize>; |
1522 | | type Bounded = Range<usize>; |
1523 | | |
1524 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1525 | 0 | (Bound::Unbounded, Bound::Excluded(self.end)) |
1526 | 0 | } |
1527 | | |
1528 | 0 | fn contains(&self, item: &usize) -> bool { |
1529 | 0 | RangeBounds::contains(self, item) |
1530 | 0 | } |
1531 | | |
1532 | 0 | fn is_inverted(&self) -> bool { |
1533 | 0 | false |
1534 | 0 | } |
1535 | | |
1536 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1537 | 0 | if self.end == 0 { |
1538 | 0 | Range::default() |
1539 | | } else { |
1540 | 0 | 0..self.end - 1 |
1541 | | } |
1542 | 0 | } |
1543 | | |
1544 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1545 | 0 | if self.end == 0 { |
1546 | 0 | Range::default() |
1547 | | } else { |
1548 | 0 | 0..self.end - 1 |
1549 | | } |
1550 | 0 | } |
1551 | | } |
1552 | | |
1553 | | impl NomRange<usize> for RangeToInclusive<usize> { |
1554 | | type Saturating = Range<usize>; |
1555 | | type Bounded = Range<usize>; |
1556 | | |
1557 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1558 | 0 | (Bound::Unbounded, Bound::Included(self.end)) |
1559 | 0 | } |
1560 | | |
1561 | 0 | fn contains(&self, item: &usize) -> bool { |
1562 | 0 | RangeBounds::contains(self, item) |
1563 | 0 | } |
1564 | | |
1565 | 0 | fn is_inverted(&self) -> bool { |
1566 | 0 | false |
1567 | 0 | } |
1568 | | |
1569 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1570 | 0 | 0..self.end |
1571 | 0 | } |
1572 | | |
1573 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1574 | 0 | 0..self.end |
1575 | 0 | } |
1576 | | } |
1577 | | |
1578 | | impl NomRange<usize> for RangeFull { |
1579 | | type Saturating = SaturatingIterator; |
1580 | | type Bounded = Range<usize>; |
1581 | | |
1582 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1583 | 0 | (Bound::Unbounded, Bound::Unbounded) |
1584 | 0 | } |
1585 | | |
1586 | 0 | fn contains(&self, item: &usize) -> bool { |
1587 | 0 | RangeBounds::contains(self, item) |
1588 | 0 | } |
1589 | | |
1590 | 0 | fn is_inverted(&self) -> bool { |
1591 | 0 | false |
1592 | 0 | } |
1593 | | |
1594 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1595 | 0 | SaturatingIterator { count: 0 } |
1596 | 0 | } |
1597 | | |
1598 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1599 | 0 | 0..usize::MAX |
1600 | 0 | } |
1601 | | } |
1602 | | |
1603 | | impl NomRange<usize> for usize { |
1604 | | type Saturating = Range<usize>; |
1605 | | type Bounded = Range<usize>; |
1606 | | |
1607 | 0 | fn bounds(&self) -> (Bound<usize>, Bound<usize>) { |
1608 | 0 | (Bound::Included(*self), Bound::Included(*self)) |
1609 | 0 | } |
1610 | | |
1611 | 0 | fn contains(&self, item: &usize) -> bool { |
1612 | 0 | self == item |
1613 | 0 | } |
1614 | | |
1615 | 0 | fn is_inverted(&self) -> bool { |
1616 | 0 | false |
1617 | 0 | } |
1618 | | |
1619 | 0 | fn saturating_iter(&self) -> Self::Saturating { |
1620 | 0 | 0..*self |
1621 | 0 | } |
1622 | | |
1623 | 0 | fn bounded_iter(&self) -> Self::Bounded { |
1624 | 0 | 0..*self |
1625 | 0 | } |
1626 | | } |
1627 | | |
1628 | | #[cfg(test)] |
1629 | | mod tests { |
1630 | | use super::*; |
1631 | | |
1632 | | #[test] |
1633 | | fn test_offset_u8() { |
1634 | | let s = b"abcd123"; |
1635 | | let a = &s[..]; |
1636 | | let b = &a[2..]; |
1637 | | let c = &a[..4]; |
1638 | | let d = &a[3..5]; |
1639 | | assert_eq!(a.offset(b), 2); |
1640 | | assert_eq!(a.offset(c), 0); |
1641 | | assert_eq!(a.offset(d), 3); |
1642 | | } |
1643 | | |
1644 | | #[test] |
1645 | | fn test_offset_str() { |
1646 | | let a = "abcřèÂßÇd123"; |
1647 | | let b = &a[7..]; |
1648 | | let c = &a[..5]; |
1649 | | let d = &a[5..9]; |
1650 | | assert_eq!(a.offset(b), 7); |
1651 | | assert_eq!(a.offset(c), 0); |
1652 | | assert_eq!(a.offset(d), 5); |
1653 | | } |
1654 | | |
1655 | | #[test] |
1656 | | fn test_slice_index() { |
1657 | | let a = "abcřèÂßÇd123"; |
1658 | | assert_eq!(a.slice_index(0), Ok(0)); |
1659 | | assert_eq!(a.slice_index(2), Ok(2)); |
1660 | | } |
1661 | | |
1662 | | #[test] |
1663 | | fn test_slice_index_utf8() { |
1664 | | let a = "a¡€💢€¡a"; |
1665 | | |
1666 | | for (c, len) in a.chars().zip([1, 2, 3, 4, 3, 2, 1]) { |
1667 | | assert_eq!(c.len(), len); |
1668 | | } |
1669 | | |
1670 | | assert_eq!(a.slice_index(0), Ok(0)); |
1671 | | assert_eq!(a.slice_index(1), Ok(1)); |
1672 | | assert_eq!(a.slice_index(2), Ok(3)); |
1673 | | assert_eq!(a.slice_index(3), Ok(6)); |
1674 | | assert_eq!(a.slice_index(4), Ok(10)); |
1675 | | assert_eq!(a.slice_index(5), Ok(13)); |
1676 | | assert_eq!(a.slice_index(6), Ok(15)); |
1677 | | assert_eq!(a.slice_index(7), Ok(16)); |
1678 | | |
1679 | | assert!(a.slice_index(8).is_err()); |
1680 | | } |
1681 | | } |