Skip to main content

Crate ot_tools_io_derive

Crate ot_tools_io_derive 

Source
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 SettingEnum to account for all lower resolution unsigned type variants (includes borrow variants too).

Derive Macros§

ArrayDefaults
Macro to create a standard [Self; N] implementation of ot_tools_io::DefaultsArray on a type, i.e. a standard array filled with an inferred volume of defaults instances based on type hints
AsMutDerive
Adds a basic AsMut trait implementation on the type.
AsRefDerive
Adds a basic AsRef trait implementation on the type.
BoxedArrayDefaults
Macro to create a standard Box<serde_big_array::Array<Self, N>> implementation of ot_tools_io::DefaultsArray on a type, i.e. a non-standard array filled with an inferred volume of defaults instances based on type hints Requires an existing implementation of Defaults<[Self; N]> on the type.
ContainerArrayMethods
Adds a bunch of boilerplate methods for a new array container type.
IntegrityChecks
Adds the ot_tools_io::CheckIntegrity trait to a type – adding the check_integrity() method for running header, file version and checksum validation
IntoSigneds
Adds implementations for Into<i8>, Into<i16> and Into<i32>.
IntoUnsigneds
Adds implementations for Into<u8>, Into<u16> and Into<u32>.
IsDefaultCheck
Adds the default implementation of ot_tools_io::IsDefault to a type
WithStdError
Adds std::error::Error to a type