#[derive(AsRef)]
{
// Attributes available to this derive:
#[as_ref]
}
Expand description
Implement AsRef for a structure.
ยงSample.
use derive_tools::AsRef;
#[ derive( AsRef ) ]
struct MyStruct
{
#[ as_ref( original ) ]
a: i32,
b: i32,
}
let my_struct = MyStruct { a: 1, b: 2 };
dbg!( my_struct.as_ref() );To learn more about the feature, study the module derive_tools::AsRef.