Expand description
Derive macros for boilerplate trait implementation in the ot_tools_io
library crate
Attribute Macros§
- enum_
try_ from_ i32_ to_ signed_ types - Same as
enum_try_from_u32_to_unsigned_types, but for signed types (32-bit and below). - enum_
try_ from_ u32_ to_ unsigned_ types - Macro that expands an existing
impl TryFrom<u32> for SettingEnumto account for all lower resolution unsigned type variants (includes borrow variants too).
Derive Macros§
- Array
Defaults - Macro to create a standard
[Self; N]implementation ofot_tools_io::DefaultsArrayon a type, i.e. a standard array filled with an inferred volume of defaults instances based on type hints - AsMut
Derive - Adds a basic
AsMuttrait implementation on the type. - AsRef
Derive - Adds a basic
AsReftrait implementation on the type. - Boxed
Array Defaults - Macro to create a standard
Box<serde_big_array::Array<Self, N>>implementation ofot_tools_io::DefaultsArrayon a type, i.e. a non-standard array filled with an inferred volume of defaults instances based on type hints Requires an existing implementation ofDefaults<[Self; N]>on the type. - Container
Array Methods - Adds a bunch of boilerplate methods for a new array container type.
- Integrity
Checks - Adds the
ot_tools_io::CheckIntegritytrait to a type – adding thecheck_integrity()method for running header, file version and checksum validation - Into
Signeds - Adds implementations for
Into<i8>,Into<i16>andInto<i32>. - Into
Unsigneds - Adds implementations for
Into<u8>,Into<u16>andInto<u32>. - IsDefault
Check - Adds the default implementation of
ot_tools_io::IsDefaultto a type - With
StdError - Adds
std::error::Errorto a type