From

Derive Macro From 

Source
#[derive(From)]
{
    // Attributes available to this derive:
    #[from]
}
Expand description

Implement From for a structure.

ยงSample.

use derive_tools::From;

#[ derive( From ) ]
struct MyStruct( i32 );

let my_struct = MyStruct::from( 13 );
dbg!( my_struct.0 );

To learn more about the feature, study the module derive_tools::From.