Trait attribute_derive::parsing::AttributePositional

source ·
pub trait AttributePositional: AttributeBase {
    // Required method
    fn parse_positional(
        input: ParseStream<'_>,
    ) -> Result<Option<SpannedValue<Self::Partial>>>;
}
Expand description

Values that can be parsed positionally, i.e., without a name, e.g. "literal", a + b, true.

When deriving FromAttr this behavior is enabled via putting #[attr(positional)] on the field.

The trait is implemented for each AttributeValue that implements the marker trait PositionalValue.

Required Methods§

source

fn parse_positional( input: ParseStream<'_>, ) -> Result<Option<SpannedValue<Self::Partial>>>

Parses Self, positionally.

Note: This needs to stop parsing at the end of the value, before a possible following , and further arguments.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AttributePositional for bool

source§

impl<T: AttributePositional + AttributePeekable> AttributePositional for Option<T>

Implementors§