macro_toolset

Macro wrapper

Source
macro_rules! wrapper {
    ($vis:vis $name:ident => $vis_inner:vis $inner:ty$(, derive($($derive:path),+))?) => { ... };
}
Expand description

Helper macro for creating a wrapper type.

The wrapper type will implement Deref, DerefMut, From and AsRef.

ยงExample

wrapper!(pub MyString => pub String);
// derive is OK!
wrapper!(pub MyStringDerived => pub String, derive(Debug, Clone, PartialEq, Eq, Hash));