Attribute Macro utility_types::omit [−][src]
#[omit]Expand description
Constructs a struct by picking fields which not in the set from the original struct.
Example
#[omit(AuthorLikedComments, [content, link], [Debug])]
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>
}
#[derive(Debug)]
struct AuthorLikedComments<T> {
author: String,
liked: usize,
comments: T,
}Notice
Currently, generics are not analyzed. So rustc will complain if the field with generic is not included in the generated struct.