Attribute Macro utility_types::required [−][src]
#[required]Expand description
Constructs a struct consisting of all properties of the original struct set to required. The opposite of partial.
Example
#[required(RequiredArticle)]
struct Article<T> {
author: String,
content: String,
liked: usize,
comments: T,
link: Option<String>
}The code above will become this:
struct Article<T> {
author: String,
content: String,
liked: usize,
comments: T,
link: Option<String>
}
struct RequiredArticle<T> {
author: String,
content: String,
liked: usize,
comments: T,
link: String
}Notice
Currently, only one level of Option is removed.