[][src]Crate amplify

Amplifying Rust language capabilities: multiple generic trait implementations, type wrappers, derive macros.

Minimum supported rust compiler version (MSRV): 1.46 (stable channel)

Modules

internet

Universal addresses that support IPv4, IPv6 and Tor

Macros

bmap

Macro for creating [BTreeMap] in the same manner as vec! is used for Vec:

bset

Macro for creating [BTreeSet] in the same manner as vec! is used for Vec:

impl_into_stringly

Impls From for Stringly where String: Into, T: Display

impl_into_stringly_standard

Implements impl_into_stringly for $type and traits with $type

impl_try_from_stringly

impls TryFrom where T: Deref<Target=str> in terms of FromStr.

impl_try_from_stringly_standard

Calls impl_try_from_stringly!() with a set of standard stringly types.

list

Macro for creating [LinkedList] in the same manner as vec! is used for Vec:

map

Macro for creating [HashMap] in the same manner as vec! is used for Vec:

s

Macro for quick & simple &str -> String conversion:

set

Macro for creating [HashSet] in the same manner as vec! is used for Vec:

wrapper

Macro simplifying creation of new wrapped types. It automatically implements Wrapper trait, adds default implementation for the following traits:

Structs

Holder

Helper type allowing implementation of trait object for generic types multiple times. In practice this type is never used

Traits

AsAny

Trait AsAny allows simple conversion of any type into a generic "thick" pointer &dyn Any (see ::core::any::Any), that can be later converted back to the original type with a graceful failing for all other conversions. For simple conversions it is recommended to use #[derive(AsAny)] macro from amplify_derive crate (see [amplify_derive::AsAny]).

Bipolar

Trait for splittable streams and other types, which can be separated into some two types ([Left], [Right]), like a reader and writer streams.

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