commit | ae59e8e6f63e856dba177944bd471f76d1204063 | [log] [tgz] |
---|---|---|
author | Bob Badour <bbadour@google.com> | Mon Aug 02 12:59:42 2021 -0700 |
committer | Bob Badour <bbadour@google.com> | Mon Aug 02 12:59:42 2021 -0700 |
tree | 1a79b93a17d63e669537d9add2422cbf17334d4b | |
parent | 0840946caef40f7ec9e527bd22c3fadaeb1506c1 [diff] |
[LSC] Add LOCAL_LICENSE_KINDS to external/rust/crates/rusticata-macros Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT to: Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: I397de6cefa6bbd1b10e63632229eb91418fa6d3e
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.