OuterAttribute
that implements syn::parse::Parse
trait.At the time of writing, [syn
] crate doesn't offer a way to parse outer attributes (for example,
#[repr(C)]
) without declaring a struct and reinventing a wheel by implementing [syn::parse::Parse
] trait. Unlike [syn::Attribute
],
depending on the enabled feature same_layout
or different_layout
the chosen
[different_layout::OuterAttribute
] or [same_layout::OuterAttribute
], respectively, will have
[syn::parse::Parse
] available.
```rust extern crate syn; extern crate outer_attribute;
use outerattribute::differentlayout::OuterAttribute;
fn main() {
assert!(matches!(syn::parsestr::
The default feature is different_layout
and opting for same_layout
instead can be considered when
there is some functionality that is available on [syn::Attribute
] but not on either OuterAttribute
.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.