Crate tagged_types

Crate tagged_types 

Source
Expand description

tagged-types is a library that simplifies implementation of the New type idiom.

In many cases, we want strict types, but we don’t want to spend a lot of time implementing boilerplate around them (serialization/deserialization/parsing/clone/copy, etc.).

This crate provides implementations for you. You can choose between two implementations:

  • Permissive, which provides automatic implementations of all supported traits.
  • Fine-grained, inheriting only the traits needed for your New type.

Optionally, you can also use [tagged-types-derive] to further reduce the verbosity of the implementation.

Re-exports§

pub use traits::AsRef;
pub use traits::Cloned;
pub use traits::FromInner;
pub use traits::ImplementAdd;
pub use traits::ImplementClone;
pub use traits::ImplementCopy;
pub use traits::ImplementDefault;
pub use traits::ImplementDeref;
pub use traits::ImplementDiv;
pub use traits::ImplementEq;
pub use traits::ImplementHash;
pub use traits::ImplementMul;
pub use traits::ImplementOrd;
pub use traits::ImplementPartialEq;
pub use traits::ImplementPartialOrd;
pub use traits::ImplementSub;
pub use traits::InnerAccess;
pub use traits::TransparentDebug;
pub use traits::TransparentDisplay;
pub use traits::TransparentFromInner;
pub use traits::TransparentFromStr;
pub use traits::ValueMap;
pub use traits::serde::TransparentDeserialize;
pub use traits::serde::TransparentSerialize;
pub use traits::permissive::Permissive;

Modules§

tagged_type
Definition of TaggedType.
traits
Definitions of crate’s traits.

Type Aliases§

TaggedType
Export TaggedType from top level.

Derive Macros§

Tag
Attributes