[−][src]Trait proc_macro_roids::DeriveInputExt
Functions to make it ergonomic to work with struct
ASTs.
Required methods
fn append_derives(&mut self, derives: Punctuated<NestedMeta, Comma>)
Appends derives to the list of derives.
Note: This can only be used with attribute macros, and not derive macros.
- If the
derive
attribute does not exist, one will be created. - If the
derive
attribute exists, and there are existingderive
s that overlap with the derives to append, this macro will panic with the overlapping derives. - If the
derive
attribute exists, and there are no overlappingderive
s, then they will be combined.
Panics
Panics if there are existing derive
s that overlap with the derives to append.
fn tag_parameter<NS, Tag>(&self, namespace: NS, tag: Tag) -> Option<Meta> where
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
Returns the parameter from #[namespace(tag(parameter))]
.
Parameters
namespace
: Thename()
of the first-level attribute.tag
: Thename()
of the second-level attribute.
Panics
Panics if there is more than one parameter for the tag.
fn tag_parameters<NS, Tag>(&self, namespace: NS, tag: Tag) -> Vec<Meta> where
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
Returns the parameters from #[namespace(tag(param1, param2, ..))]
.
Parameters
namespace
: Thename()
of the first-level attribute.tag
: Thename()
of the second-level attribute.
Implementations on Foreign Types
impl DeriveInputExt for DeriveInput
[src]
fn append_derives(&mut self, derives_to_append: Punctuated<NestedMeta, Comma>)
[src]
fn tag_parameter<NS, Tag>(&self, namespace: NS, tag: Tag) -> Option<Meta> where
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
[src]
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
fn tag_parameters<NS, Tag>(&self, namespace: NS, tag: Tag) -> Vec<Meta> where
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,
[src]
NS: Display,
Tag: Display,
Ident: PartialEq<NS>,
Ident: PartialEq<Tag>,