Crate lain_derive

Source

Derive Macros§

  • Implements [lain::traits::BinarySerialize] on the given struct/enum. The byteorder of fields can be overridden with #[byteorder(big)] or #[byteorder(little)]
  • A “catch-all” derive for NewFuzzed, Mutatable, and VariableObjectSize
  • Automatically implements [trait@lain::traits::Mutatable] with basic randomization
  • Implements [rand::distributions::Standard] for enums that derive this trait. This will allow you to use rand::gen() to randomly select an enum value.
  • Implements ToPrimitive<u8> for the given enum.
  • Implements ToPrimitive<u16> for the given enum.
  • Implements ToPrimitive<u32> for the given enum.
  • Implements ToPrimitive<u64> for the given enum.
  • Automatically implements [trait@lain::traits::VariableSizeObject]