1 | //! Deprecated, see [`binary`] |
2 | #![deprecated (since = "0.4.2" , note = "Replaced with `binary`" )] |
3 | #![allow (clippy::match_same_arms)] |
4 | |
5 | use crate::binary; |
6 | use crate::error::ParseError; |
7 | use crate::stream::{AsBytes, Stream, StreamIsPartial}; |
8 | use crate::IResult; |
9 | use crate::Parser; |
10 | |
11 | pub use binary::Endianness; |
12 | |
13 | /// Deprecated, see [`binary::be_u8`] |
14 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_u8`" )] |
15 | #[inline (always)] |
16 | pub fn be_u8<I, E: ParseError<I>>(input: I) -> IResult<I, u8, E> |
17 | where |
18 | I: StreamIsPartial, |
19 | I: Stream<Token = u8>, |
20 | { |
21 | binary::be_u8(input) |
22 | } |
23 | |
24 | /// Deprecated, see [`binary::be_u16`] |
25 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_u16`" )] |
26 | #[inline (always)] |
27 | pub fn be_u16<I, E: ParseError<I>>(input: I) -> IResult<I, u16, E> |
28 | where |
29 | I: StreamIsPartial, |
30 | I: Stream<Token = u8>, |
31 | <I as Stream>::Slice: AsBytes, |
32 | { |
33 | binary::be_u16(input) |
34 | } |
35 | |
36 | /// Deprecated, see [`binary::be_u24`] |
37 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_u24`" )] |
38 | #[inline (always)] |
39 | pub fn be_u24<I, E: ParseError<I>>(input: I) -> IResult<I, u32, E> |
40 | where |
41 | I: StreamIsPartial, |
42 | I: Stream<Token = u8>, |
43 | <I as Stream>::Slice: AsBytes, |
44 | { |
45 | binary::be_u24(input) |
46 | } |
47 | |
48 | /// Deprecated, see [`binary::be_u32`] |
49 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_u32`" )] |
50 | #[inline (always)] |
51 | pub fn be_u32<I, E: ParseError<I>>(input: I) -> IResult<I, u32, E> |
52 | where |
53 | I: StreamIsPartial, |
54 | I: Stream<Token = u8>, |
55 | <I as Stream>::Slice: AsBytes, |
56 | { |
57 | binary::be_u32(input) |
58 | } |
59 | |
60 | /// Deprecated, see [`binary::be_u64`] |
61 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_u64`" )] |
62 | #[inline (always)] |
63 | pub fn be_u64<I, E: ParseError<I>>(input: I) -> IResult<I, u64, E> |
64 | where |
65 | I: StreamIsPartial, |
66 | I: Stream<Token = u8>, |
67 | <I as Stream>::Slice: AsBytes, |
68 | { |
69 | binary::be_u64(input) |
70 | } |
71 | |
72 | /// Deprecated, see [`binary::be_u128`] |
73 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_u128`" )] |
74 | #[inline (always)] |
75 | pub fn be_u128<I, E: ParseError<I>>(input: I) -> IResult<I, u128, E> |
76 | where |
77 | I: StreamIsPartial, |
78 | I: Stream<Token = u8>, |
79 | <I as Stream>::Slice: AsBytes, |
80 | { |
81 | binary::be_u128(input) |
82 | } |
83 | |
84 | /// Deprecated, see [`binary::be_i8`] |
85 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_i8`" )] |
86 | #[inline (always)] |
87 | pub fn be_i8<I, E: ParseError<I>>(input: I) -> IResult<I, i8, E> |
88 | where |
89 | I: StreamIsPartial, |
90 | I: Stream<Token = u8>, |
91 | { |
92 | binary::be_i8(input) |
93 | } |
94 | |
95 | /// Deprecated, see [`binary::be_i16`] |
96 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_i16`" )] |
97 | #[inline (always)] |
98 | pub fn be_i16<I, E: ParseError<I>>(input: I) -> IResult<I, i16, E> |
99 | where |
100 | I: StreamIsPartial, |
101 | I: Stream<Token = u8>, |
102 | <I as Stream>::Slice: AsBytes, |
103 | { |
104 | binary::be_i16(input) |
105 | } |
106 | |
107 | /// Deprecated, see [`binary::be_i24`] |
108 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_i24`" )] |
109 | #[inline (always)] |
110 | pub fn be_i24<I, E: ParseError<I>>(input: I) -> IResult<I, i32, E> |
111 | where |
112 | I: StreamIsPartial, |
113 | I: Stream<Token = u8>, |
114 | <I as Stream>::Slice: AsBytes, |
115 | { |
116 | binary::be_i24(input) |
117 | } |
118 | |
119 | /// Deprecated, see [`binary::be_i32`] |
120 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_i32`" )] |
121 | #[inline (always)] |
122 | pub fn be_i32<I, E: ParseError<I>>(input: I) -> IResult<I, i32, E> |
123 | where |
124 | I: StreamIsPartial, |
125 | I: Stream<Token = u8>, |
126 | <I as Stream>::Slice: AsBytes, |
127 | { |
128 | binary::be_i32(input) |
129 | } |
130 | |
131 | /// Deprecated, see [`binary::be_i64`] |
132 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_i64`" )] |
133 | #[inline (always)] |
134 | pub fn be_i64<I, E: ParseError<I>>(input: I) -> IResult<I, i64, E> |
135 | where |
136 | I: StreamIsPartial, |
137 | I: Stream<Token = u8>, |
138 | <I as Stream>::Slice: AsBytes, |
139 | { |
140 | binary::be_i64(input) |
141 | } |
142 | |
143 | /// Deprecated, see [`binary::be_i128`] |
144 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_i128`" )] |
145 | #[inline (always)] |
146 | pub fn be_i128<I, E: ParseError<I>>(input: I) -> IResult<I, i128, E> |
147 | where |
148 | I: StreamIsPartial, |
149 | I: Stream<Token = u8>, |
150 | <I as Stream>::Slice: AsBytes, |
151 | { |
152 | binary::be_i128(input) |
153 | } |
154 | |
155 | /// Deprecated, see [`binary::le_u8`] |
156 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_u8`" )] |
157 | #[inline (always)] |
158 | pub fn le_u8<I, E: ParseError<I>>(input: I) -> IResult<I, u8, E> |
159 | where |
160 | I: StreamIsPartial, |
161 | I: Stream<Token = u8>, |
162 | { |
163 | binary::le_u8(input) |
164 | } |
165 | |
166 | /// Deprecated, see [`binary::le_u16`] |
167 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_u16`" )] |
168 | #[inline (always)] |
169 | pub fn le_u16<I, E: ParseError<I>>(input: I) -> IResult<I, u16, E> |
170 | where |
171 | I: StreamIsPartial, |
172 | I: Stream<Token = u8>, |
173 | <I as Stream>::Slice: AsBytes, |
174 | { |
175 | binary::le_u16(input) |
176 | } |
177 | |
178 | /// Deprecated, see [`binary::le_u24`] |
179 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_u24`" )] |
180 | #[inline (always)] |
181 | pub fn le_u24<I, E: ParseError<I>>(input: I) -> IResult<I, u32, E> |
182 | where |
183 | I: StreamIsPartial, |
184 | I: Stream<Token = u8>, |
185 | <I as Stream>::Slice: AsBytes, |
186 | { |
187 | binary::le_u24(input) |
188 | } |
189 | |
190 | /// Deprecated, see [`binary::le_u32`] |
191 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_u32`" )] |
192 | #[inline (always)] |
193 | pub fn le_u32<I, E: ParseError<I>>(input: I) -> IResult<I, u32, E> |
194 | where |
195 | I: StreamIsPartial, |
196 | I: Stream<Token = u8>, |
197 | <I as Stream>::Slice: AsBytes, |
198 | { |
199 | binary::le_u32(input) |
200 | } |
201 | |
202 | /// Deprecated, see [`binary::le_u64`] |
203 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_u64`" )] |
204 | #[inline (always)] |
205 | pub fn le_u64<I, E: ParseError<I>>(input: I) -> IResult<I, u64, E> |
206 | where |
207 | I: StreamIsPartial, |
208 | I: Stream<Token = u8>, |
209 | <I as Stream>::Slice: AsBytes, |
210 | { |
211 | binary::le_u64(input) |
212 | } |
213 | |
214 | /// Deprecated, see [`binary::le_u128`] |
215 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_u128`" )] |
216 | #[inline (always)] |
217 | pub fn le_u128<I, E: ParseError<I>>(input: I) -> IResult<I, u128, E> |
218 | where |
219 | I: StreamIsPartial, |
220 | I: Stream<Token = u8>, |
221 | <I as Stream>::Slice: AsBytes, |
222 | { |
223 | binary::le_u128(input) |
224 | } |
225 | |
226 | /// Deprecated, see [`binary::le_i8`] |
227 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_i8`" )] |
228 | #[inline (always)] |
229 | pub fn le_i8<I, E: ParseError<I>>(input: I) -> IResult<I, i8, E> |
230 | where |
231 | I: StreamIsPartial, |
232 | I: Stream<Token = u8>, |
233 | { |
234 | binary::le_i8(input) |
235 | } |
236 | |
237 | /// Deprecated, see [`binary::le_i16`] |
238 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_i16`" )] |
239 | #[inline (always)] |
240 | pub fn le_i16<I, E: ParseError<I>>(input: I) -> IResult<I, i16, E> |
241 | where |
242 | I: StreamIsPartial, |
243 | I: Stream<Token = u8>, |
244 | <I as Stream>::Slice: AsBytes, |
245 | { |
246 | binary::le_i16(input) |
247 | } |
248 | |
249 | /// Deprecated, see [`binary::le_i24`] |
250 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_i24`" )] |
251 | #[inline (always)] |
252 | pub fn le_i24<I, E: ParseError<I>>(input: I) -> IResult<I, i32, E> |
253 | where |
254 | I: StreamIsPartial, |
255 | I: Stream<Token = u8>, |
256 | <I as Stream>::Slice: AsBytes, |
257 | { |
258 | binary::le_i24(input) |
259 | } |
260 | |
261 | /// Deprecated, see [`binary::le_i32`] |
262 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_i32`" )] |
263 | #[inline (always)] |
264 | pub fn le_i32<I, E: ParseError<I>>(input: I) -> IResult<I, i32, E> |
265 | where |
266 | I: StreamIsPartial, |
267 | I: Stream<Token = u8>, |
268 | <I as Stream>::Slice: AsBytes, |
269 | { |
270 | binary::le_i32(input) |
271 | } |
272 | |
273 | /// Deprecated, see [`binary::le_i64`] |
274 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_i64`" )] |
275 | #[inline (always)] |
276 | pub fn le_i64<I, E: ParseError<I>>(input: I) -> IResult<I, i64, E> |
277 | where |
278 | I: StreamIsPartial, |
279 | I: Stream<Token = u8>, |
280 | <I as Stream>::Slice: AsBytes, |
281 | { |
282 | binary::le_i64(input) |
283 | } |
284 | |
285 | /// Deprecated, see [`binary::le_i128`] |
286 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_i128`" )] |
287 | #[inline (always)] |
288 | pub fn le_i128<I, E: ParseError<I>>(input: I) -> IResult<I, i128, E> |
289 | where |
290 | I: StreamIsPartial, |
291 | I: Stream<Token = u8>, |
292 | <I as Stream>::Slice: AsBytes, |
293 | { |
294 | binary::le_i128(input) |
295 | } |
296 | |
297 | /// Deprecated, see [`binary::u8`] |
298 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::u8`" )] |
299 | #[inline (always)] |
300 | pub fn u8<I, E: ParseError<I>>(input: I) -> IResult<I, u8, E> |
301 | where |
302 | I: StreamIsPartial, |
303 | I: Stream<Token = u8>, |
304 | { |
305 | binary::u8.parse_next(input) |
306 | } |
307 | |
308 | /// Deprecated, see [`binary::u16`] |
309 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::u16`" )] |
310 | #[inline (always)] |
311 | pub fn u16<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, u16, E> |
312 | where |
313 | I: StreamIsPartial, |
314 | I: Stream<Token = u8>, |
315 | <I as Stream>::Slice: AsBytes, |
316 | { |
317 | binary::u16(endian) |
318 | } |
319 | |
320 | /// Deprecated, see [`binary::u24`] |
321 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::u24`" )] |
322 | #[inline (always)] |
323 | pub fn u24<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, u32, E> |
324 | where |
325 | I: StreamIsPartial, |
326 | I: Stream<Token = u8>, |
327 | <I as Stream>::Slice: AsBytes, |
328 | { |
329 | binary::u24(endian) |
330 | } |
331 | |
332 | /// Deprecated, see [`binary::u32`] |
333 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::u32`" )] |
334 | #[inline (always)] |
335 | pub fn u32<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, u32, E> |
336 | where |
337 | I: StreamIsPartial, |
338 | I: Stream<Token = u8>, |
339 | <I as Stream>::Slice: AsBytes, |
340 | { |
341 | binary::u32(endian) |
342 | } |
343 | |
344 | /// Deprecated, see [`binary::u64`] |
345 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::u64`" )] |
346 | #[inline (always)] |
347 | pub fn u64<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, u64, E> |
348 | where |
349 | I: StreamIsPartial, |
350 | I: Stream<Token = u8>, |
351 | <I as Stream>::Slice: AsBytes, |
352 | { |
353 | binary::u64(endian) |
354 | } |
355 | |
356 | /// Deprecated, see [`binary::u128`] |
357 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::u128`" )] |
358 | #[inline (always)] |
359 | pub fn u128<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, u128, E> |
360 | where |
361 | I: StreamIsPartial, |
362 | I: Stream<Token = u8>, |
363 | <I as Stream>::Slice: AsBytes, |
364 | { |
365 | binary::u128(endian) |
366 | } |
367 | |
368 | /// Deprecated, see [`binary::i8`] |
369 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::i8`" )] |
370 | #[inline (always)] |
371 | pub fn i8<I, E: ParseError<I>>(input: I) -> IResult<I, i8, E> |
372 | where |
373 | I: StreamIsPartial, |
374 | I: Stream<Token = u8>, |
375 | { |
376 | binary::i8.parse_next(input) |
377 | } |
378 | |
379 | /// Deprecated, see [`binary::i16`] |
380 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::i16`" )] |
381 | #[inline (always)] |
382 | pub fn i16<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, i16, E> |
383 | where |
384 | I: StreamIsPartial, |
385 | I: Stream<Token = u8>, |
386 | <I as Stream>::Slice: AsBytes, |
387 | { |
388 | binary::i16(endian) |
389 | } |
390 | |
391 | /// Deprecated, see [`binary::i24`] |
392 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::i24`" )] |
393 | #[inline (always)] |
394 | pub fn i24<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, i32, E> |
395 | where |
396 | I: StreamIsPartial, |
397 | I: Stream<Token = u8>, |
398 | <I as Stream>::Slice: AsBytes, |
399 | { |
400 | binary::i24(endian) |
401 | } |
402 | |
403 | /// Deprecated, see [`binary::i32`] |
404 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::i32`" )] |
405 | #[inline (always)] |
406 | pub fn i32<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, i32, E> |
407 | where |
408 | I: StreamIsPartial, |
409 | I: Stream<Token = u8>, |
410 | <I as Stream>::Slice: AsBytes, |
411 | { |
412 | binary::i32(endian) |
413 | } |
414 | |
415 | /// Deprecated, see [`binary::i64`] |
416 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::i64`" )] |
417 | #[inline (always)] |
418 | pub fn i64<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, i64, E> |
419 | where |
420 | I: StreamIsPartial, |
421 | I: Stream<Token = u8>, |
422 | <I as Stream>::Slice: AsBytes, |
423 | { |
424 | binary::i64(endian) |
425 | } |
426 | |
427 | /// Deprecated, see [`binary::i128`] |
428 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::i128`" )] |
429 | #[inline (always)] |
430 | pub fn i128<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, i128, E> |
431 | where |
432 | I: StreamIsPartial, |
433 | I: Stream<Token = u8>, |
434 | <I as Stream>::Slice: AsBytes, |
435 | { |
436 | binary::i128(endian) |
437 | } |
438 | |
439 | /// Deprecated, see [`binary::be_f32`] |
440 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_f32`" )] |
441 | #[inline (always)] |
442 | pub fn be_f32<I, E: ParseError<I>>(input: I) -> IResult<I, f32, E> |
443 | where |
444 | I: StreamIsPartial, |
445 | I: Stream<Token = u8>, |
446 | <I as Stream>::Slice: AsBytes, |
447 | { |
448 | binary::be_f32(input) |
449 | } |
450 | |
451 | /// Deprecated, see [`binary::be_f64`] |
452 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::be_f64`" )] |
453 | #[inline (always)] |
454 | pub fn be_f64<I, E: ParseError<I>>(input: I) -> IResult<I, f64, E> |
455 | where |
456 | I: StreamIsPartial, |
457 | I: Stream<Token = u8>, |
458 | <I as Stream>::Slice: AsBytes, |
459 | { |
460 | binary::be_f64(input) |
461 | } |
462 | |
463 | /// Deprecated, see [`binary::le_f32`] |
464 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_f32`" )] |
465 | #[inline (always)] |
466 | pub fn le_f32<I, E: ParseError<I>>(input: I) -> IResult<I, f32, E> |
467 | where |
468 | I: StreamIsPartial, |
469 | I: Stream<Token = u8>, |
470 | <I as Stream>::Slice: AsBytes, |
471 | { |
472 | binary::le_f32(input) |
473 | } |
474 | |
475 | /// Deprecated, see [`binary::le_f64`] |
476 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::le_f64`" )] |
477 | #[inline (always)] |
478 | pub fn le_f64<I, E: ParseError<I>>(input: I) -> IResult<I, f64, E> |
479 | where |
480 | I: StreamIsPartial, |
481 | I: Stream<Token = u8>, |
482 | <I as Stream>::Slice: AsBytes, |
483 | { |
484 | binary::le_f64(input) |
485 | } |
486 | |
487 | /// Deprecated, see [`binary::f32`] |
488 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::f32`" )] |
489 | #[inline (always)] |
490 | pub fn f32<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, f32, E> |
491 | where |
492 | I: StreamIsPartial, |
493 | I: Stream<Token = u8>, |
494 | <I as Stream>::Slice: AsBytes, |
495 | { |
496 | binary::f32(endian) |
497 | } |
498 | |
499 | /// Deprecated, see [`binary::f64`] |
500 | #[deprecated (since = "0.4.2" , note = "Replaced with `binary::f64`" )] |
501 | #[inline (always)] |
502 | pub fn f64<I, E: ParseError<I>>(endian: crate::number::Endianness) -> impl Parser<I, f64, E> |
503 | where |
504 | I: StreamIsPartial, |
505 | I: Stream<Token = u8>, |
506 | <I as Stream>::Slice: AsBytes, |
507 | { |
508 | binary::f64(endian) |
509 | } |
510 | |