Derive Macro clone_fields::MoveFields
source · #[derive(MoveFields)]
{
// Attributes available to this derive:
#[destinations]
}
Expand description
A derive macro for Into and From traits, converting the structures field by field.
To automagically derive the traits for your type against a DesiredTypeName add the
following attributes to it:
#[derive(MoveFields)],- and
#[destinations("DesiredTypeName")].
… and the macro will generate an implementations of Into<DesiredTypeName> and
From<DesiredTypeName> for you type then.
You can add more than one type, like #[destinations("Type1", "Type2", ...)].
It is possible to use structs with fields with different types, the only requirement is that
respective types should be “convertible” with the From and Into traits.