• Home
Name Date Size #Lines LOC

..--

.github/workflows/03-May-2024-119110

benches/03-May-2024-1813

src/03-May-2024-651484

.cargo_vcs_info.jsonD03-May-202494 66

.gitignoreD03-May-202425 43

.travis.ymlD03-May-2024875 3433

Android.bpD03-May-20242.1 KiB7267

Cargo.tomlD03-May-2024955 2826

Cargo.toml.origD03-May-2024495 1614

LICENSED03-May-202410.6 KiB202169

LICENSE-APACHED03-May-202410.6 KiB202169

LICENSE-MITD03-May-20241 KiB2622

METADATAD03-May-2024398 2019

MODULE_LICENSE_APACHE2D03-May-20240

OWNERSD03-May-2024101 54

README.mdD03-May-20242.8 KiB11971

TEST_MAPPINGD03-May-2024643 3736

cargo2android.jsonD03-May-202452 55

README.md

1# rusticata-macros
2
3[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE-MIT)
4[![Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE-APACHE)
5[![Build Status](https://travis-ci.org/rusticata/rusticata-macros.svg?branch=master)](https://travis-ci.org/rusticata/rusticata-macros)
6[![Github CI](https://github.com/rusticata/rusticata-macros/workflows/Continuous%20integration/badge.svg)](https://github.com/rusticata/rusticata-macros/actions)
7[![Crates.io Version](https://img.shields.io/crates/v/rusticata-macros.svg)](https://crates.io/crates/rusticata-macros)
8
9<!-- cargo-sync-readme start -->
10
11# Rusticata-macros
12
13Helper macros for the [rusticata](https://github.com/rusticata) project.
14
15This crate contains some additions to [nom](https://github.com/Geal/nom).
16
17For example, the [`combinator::cond_else`] function allows to apply the first parser if the
18condition is true, and the second if the condition is false:
19
20```rust
21use rusticata_macros::combinator::cond_else;
22let r: IResult<_, _, ()> = cond_else(
23        || s.len() > 1,
24        be_u16,
25        map(be_u8, u16::from)
26    )(s);
27```
28
29See the documentation for more details and examples.
30
31<!-- cargo-sync-readme end -->
32
33## Nom versions
34
35Different versions of this crate are available, depending on nom version.
36
37- `rusticata-macros` 4.x depends on nom 7
38- `rusticata-macros` 3.x depends on nom 6
39- `rusticata-macros` 2.x depends on nom 5
40
41## Documentation
42
43Crate is documented, do running `cargo doc` will crate the offline documentation.
44
45Reference documentation can be found [here](https://docs.rs/rusticata-macros/)
46
47## Changes
48
49### 4.1.0
50
51- Remove macro `slice_fixed`
52
53### 4.0.0
54
55- Upgrade to nom 7
56  - Remove macros
57
58### 3.0.1
59
60- Add `be_var_u64` and `le_var_u64`
61
62### 3.0.0
63
64- Upgrade to nom 6
65
66### 2.1.0
67
68- Add common trait `Serialize` for structures serialization
69
70### 2.0.4
71
72- Add function version of most combinators
73
74### 2.0.3
75
76- Add macros `q` (quote) and `align32`
77
78### 2.0.2
79
80- Add `upgrade_error` and `upgrade_error_to`
81
82### 2.0.1
83
84- Add macro `custom_check`
85- Add macro `flat_take`
86
87### 2.0.0
88
89- Upgrade to nom 5
90- Debug types: use newtypes
91
92### 1.1.0
93
94- Add macro `newtype_enum`
95
96### 1.0.0
97
98- Upgrade to nom 4.0
99  - Warning: this is a breaking change!
100- Mark `parse_uint24` as deprecated
101
102## License
103
104Licensed under either of
105
106 * Apache License, Version 2.0
107   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
108 * MIT license
109   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
110
111at your option.
112
113## Contribution
114
115Unless you explicitly state otherwise, any contribution intentionally submitted
116for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
117dual licensed as above, without any additional terms or conditions.
118
119