Skip to main content

CheckInput

Struct CheckInput 

Source
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: TokenStream

The check’s arguments, (ARGS).

§item: Item

The cfg-evaluated item, with the owned attributes.

§owned: OwnedAttrs

The attribute names that the check declared with attributes in check. Empty when the input was parsed by hand.

Implementations§

Source§

impl CheckInput

Source

pub fn with_owned(self, owned: OwnedAttrs) -> Self

The same input with the declared attribute names.

Source

pub fn owned_attributes(&self) -> Vec<Attribute>

The owned attributes in the item, in source order: what the check validates (OwnedAttrs::find).

Trait Implementations§

Source§

impl Parse for CheckInput

Source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.