Derive Macro rocket::UriDisplayPath

source ·
#[derive(UriDisplayPath)]
Expand description

Derive for the UriDisplay<Path> trait.

The UriDisplay<Path> derive can only be applied to tuple structs with one field.

#[derive(UriDisplayPath)]
struct Name(String);

#[derive(UriDisplayPath)]
struct Age(usize);

The field’s type is required to implement UriDisplay<Path>.

The derive generates an implementation of the UriDisplay<Path> trait. The implementation calls Formatter::write_value() for the field.