LibAFL_derive: Derive Macros for LibAFL
The libafl_derive crate offers derive macros, such as #[derive(SerdeAny)].
Available Derive Macros
#[derive(SerdeAny)]
This macro implements the SerdeAny trait for a type. This is necessary to store the type in a SerdeAnyMap, a key component for type-safe storage of different data types in LibAFL.
Usage:
use SerdeAny;
use ;
#[derive(Display)]
This macro implements the core::fmt::Display trait for a struct. It generates a Display implementation that concatenates the string representations of all fields, separated by spaces.
Special Handling:
Option<T>: If the value isSome(inner), the inner value is displayed. If it isNone, nothing is displayed.Vec<T>: The elements of the vector are displayed, each separated by a space.
Example:
use Display;
use Display;
let instance = MyStruct ;
// The following will print: " hello 42 1 2 3"
println!;
The LibAFL Project
The LibAFL project is part of AFLplusplus and maintained by
- Andrea Fioraldi andrea@aflplus.plus
- Dominik Maier dominik@aflplus.plus
- s1341 github@shmarya.net
- Dongjia Zhang toka@aflplus.plus
- Addison Crump me@addisoncrump.info
Contributing
For bugs, feel free to open issues or contact us directly. Thank you for your support. <3
Even though we will gladly assist you in finishing up your PR, try to
- keep all the crates compiling with stable rust (hide the eventual non-stable code under
cfgs.) - run
cargo nightly fmton your code before pushing - check the output of
cargo clippy --allor./clippy.sh - run
cargo build --no-default-featuresto check forno_stdcompatibility (and possibly add#[cfg(feature = "std")]) to hide parts of your code.
Some parts in this list may sound hard, but don't be afraid to open a PR if you cannot fix them by yourself. We will gladly assist.