Derive Macro derive_tools::DerefMut
source · #[derive(DerefMut)]Expand description
Derive macro to implement Deref when-ever it’s possible to do automatically.
Sample :: struct instead of macro.
Write this
use derives::*;
#[ derive( Deref, DerefMut ) ]
pub struct IsTransparent( bool );Instead of this
pub struct IsTransparent( bool );
impl core::ops::Deref for IsTransparent
{
type Target = bool;
#[ inline( always ) ]
fn deref( &self ) -> &Self::Target
{
&self.0
}
}
impl core::ops::DerefMut for IsTransparent
{
#[ inline( always ) ]
fn deref_mut( &mut self ) -> &mut Self::Target
{
&mut self.0
}
}