pub trait AttributeExt12 {
// Required method
fn call_in_parens<T, F>(&self, f: F) -> Result<T>
where F: FnOnce(ParseStream<'_>) -> Result<T>;
// Provided method
fn parse_in_parens<T: Parse>(&self) -> Result<T> { ... }
}Expand description
Helper trait to deal with syn’s idea of attribute contents
We expect all our attributes to be parenthesised.
Required Methods§
Sourcefn call_in_parens<T, F>(&self, f: F) -> Result<T>
fn call_in_parens<T, F>(&self, f: F) -> Result<T>
Like parse_in_parens, but takes a parser callback.
Provided Methods§
Sourcefn parse_in_parens<T: Parse>(&self) -> Result<T>
fn parse_in_parens<T: Parse>(&self) -> Result<T>
Parse the content within an #[attribute(content)]
Parses the content as T.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.