Crates.io | binread_derive |
lib.rs | binread_derive |
version | 2.1.0 |
source | src |
created_at | 2020-04-03 19:20:46.058923 |
updated_at | 2021-08-25 04:39:13.868333 |
description | Derive macro for binread |
homepage | |
repository | https://github.com/jam1garner/binread |
max_upload_size | |
id | 226021 |
size | 97,329 |
BinRead
In all cases, look to existing directives to follow established code and test conventions.
parser::keywords
.parser::attrs
. If you need a
new meta-type, add it to parser::meta_types
along with tests.CondEndian
), add
that to a new parser::types
module and export it from parser::types
. New
types must ultimately implement parser::TrySet
, but can sometimes do so
more simply (using trait generic impls) by implementing From
or TryFrom
instead.parser::top_level_attrs
and parser::field_level_attrs
.ReadMode
), add validation in either FromInput::push_field
(if the
validation can occur immediately after the field is constructed) or
FromInput::validate
(if it can only be validated after the entire struct
has been parsed).codegen::read_options
.binread
crate’s tests
directory.parser::tests
(in mod.rs
) and add
identical trybuild tests to the binread
crate’s tests/ui
directory. (A
nightly compiler is required to run the trybuild tests; see the comment in
binread::tests::ui
for more detail.)