From in std::from - Rust (original) (raw)

std::from

Derive Macro From

Source

#[derive(From)]

🔬This is a nightly-only experimental API. (derive_from #144889)

Expand description

Derive macro generating an impl of the trait From. Currently, it can only be used on single-field structs.