commit | 64b9a730f06d31232c9d24377268e4145fdcdb3c | [log] [tgz] |
---|---|---|
author | Yiming Jing <yimingjing@google.com> | Tue Jul 20 19:48:22 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jul 20 19:48:22 2021 +0000 |
tree | d3d32479033875e0aaee81b99bd0939351efa3fd | |
parent | 51861d1df8cfa907307c8c2028b27573704275cb [diff] | |
parent | 7053a097a8f6065e83bba264b05f3c6bdf25d002 [diff] |
Add Android.bp am: 0840946cae am: 866d70e04b am: adaf2ee064 am: 7053a097a8 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/rusticata-macros/+/1770172 Change-Id: I6eb3dfc4dfad239e87264cbb15cf35a60e93de81
Helper macros for the rusticata project.
This crate contains some additions to nom.
For example, the error_if!
macro allows to test a condition and return an error from the parser if the condition fails:
use rusticata_macros::error_if; let r : IResult<&[u8],()> = do_parse!( s, l: be_u8 >> error_if!(l < 4, ErrorKind::Verify) >> data: take!(l - 4) >> (()) );
See the documentation for more details and examples.
Different versions of this crate are available, depending on nom version.
rusticata-macros
0.3.x depends on nom 6rusticata-macros
0.2.x depends on nom 5Crate is documented, do running cargo doc
will crate the offline documentation.
Reference documentation can be found here
be_var_u64
and le_var_u64
Serialize
for structures serializationq
(quote) and align32
upgrade_error
and upgrade_error_to
custom_check
flat_take
newtype_enum
parse_uint24
as deprecatedLicensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.