pub struct CheckInput {
pub args: TokenStream,
pub item: Item,
pub owned: OwnedAttrs,
}Expand description
What a check receives: (ARGS), ITEM, after the prefix @announce_format "1" when
announce calls the check (a call by hand has no prefix, and parses as well).
The item has its #[cfg] evaluated, and it still has the attributes that the
checks own (see OwnedAttrs), so the check can validate them. check parses
this and also answers the attribute query. Parsing a CheckInput by hand fails
with an error that says so when #[announce] sends the query.
Fields§
§args: TokenStreamThe check’s arguments, (ARGS).
item: ItemThe cfg-evaluated item, with the owned attributes.
owned: OwnedAttrsThe attribute names that the check declared with attributes in
check. Empty when the input was parsed by hand.
Implementations§
Source§impl CheckInput
impl CheckInput
Sourcepub fn with_owned(self, owned: OwnedAttrs) -> Self
pub fn with_owned(self, owned: OwnedAttrs) -> Self
The same input with the declared attribute names.
Sourcepub fn owned_attributes(&self) -> Vec<Attribute>
pub fn owned_attributes(&self) -> Vec<Attribute>
The owned attributes in the item, in source order: what the check
validates (OwnedAttrs::find).