Crate amplify[−][src]
Amplifying Rust language capabilities: multiple generic trait implementations, type wrappers, derive macros.
Minimum supported rust compiler version (MSRV): 1.46 (stable channel)
Re-exports
pub use crate::strategy::Holder; |
Modules
flags | Types for building flag-based APIs and functionality |
hex | Hex encoding and decoding |
num | Big unsigned integer types |
strategy | This is a trick for rust compiler helping to distinguish types implementing mutually-exclusive traits (required until negative trait impls will be there) Implemented after concept by Martin Habovštiak martin.habovstiak@gmail.com |
Macros
bmap | Macro for creating [ |
bset | Macro for creating [ |
default | Shorthand for |
dumb | Shorthand for |
empty | This macro allows more semantically-clear code (which can be used especially with structure initialization), indicating that instead of type value we are generating empty collection types |
list | Macro for creating [ |
map | Macro for creating [ |
none | This macro allows more semantically-clear code (which can be used especially with structure initialization), indicating that instead of type value we are generating no value at all (empty collection or data structure filled with information indicating absence of data) |
s | Macro for quick & simple |
set | Macro for creating [ |
zero | This macro allows more semantically-clear code (which can be used especially with structure initialization), indicating that instead of type value we are generating zero values (int types or byte slices filled with zeros) |
Structs
IoError | Copyable & cloneable I/O error type represented by the error kind function. |
Traits
AsAny | Trait |
Bipolar | Trait for splittable streams and other types, which can be separated into
some two types ([ |
DumbDefault | Used as an alternative to default for test and prototyping purposes, when a type can’t have a default value, but you need to generate some dumb data. |
Wrapper | Trait defining wrapped types (“newtypes” in rust terminology). Wrapped types are used for allowing implemeting foreign traits to foreign types: https://doc.rust-lang.org/stable/rust-by-example/generics/new_types.html |
Derive Macros
AsAny | Trait [ |
Display | Usage |
Error | Error derive macro works to the full extend only when other derive macros
are used. With |
From | Implements |
Getters | Derives getter methods for structures. The return type and naming of the methods depends on the provided attribute arguments. |
Wrapper | Creates rust new type wrapping existing type. Can be used in sturctures
containing multiple named or unnamed fields; in this case the field you’d
like to wrap should be marked with |