Attribute Macro kas_macros::autoimpl

source ·
#[autoimpl]
Expand description

A variant of the standard derive macro

See impl_tools::autoimpl for full documentation.

The following traits are supported:

Pathignoreusingnotes
::core::borrow::Borrow<T>-borrow targetT is type of target field
::core::borrow::BorrowMut<T>-borrow targetT is type of target field
::core::clone::Cloneyes-ignored fields use Default::default()
::core::cmp::Eq*-*allowed with PartialEq
::core::cmp::Ordyes-
::core::cmp::PartialEqyes-
::core::cmp::PartialOrdyes-
::core::convert::AsRef<T>-ref targetT is type of target field
::core::convert::AsMut<T>-ref targetT is type of target field
::core::default::Default--impl_default is a more flexible alternative
::core::fmt::Debugyes-
::core::hash::Hashyes-
::core::marker::Copy*-*allowed with Clone
::core::ops::Deref-deref targettype Target is type of target field
::core::ops::DerefMut-deref targettype Target is type of target field
::kas::classes::HasBool-deref target
::kas::classes::HasStr-deref target
::kas::classes::HasString-deref target
class_traits-deref targetimplements each kas::class trait

Examples

Implement all kas::class trait over a wrapper type:

# use kas_macros::autoimpl;
#[autoimpl(class_traits using self.0 where T: trait)]
struct WrappingType<T>(T);