Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

The derive macro is a procedural macro that generates automatically an implementation for selected traits.

In the following example, both Debug and Clone are implemented for User with generated default implementations:

The Clone trait allows us to make an explicit copy of an existing instance:

Couldn't automatically determine type of variable `v`.
Please give it an explicit type.

And the Debug trait allows to automatically convert an instance into a string and print it: