[][src]Struct macro_input_core::StructLint

pub struct StructLint<'a> { /* fields omitted */ }

a lint for syn::ItemStruct or syn::DeriveInput

Example

use macro_input::{DefaultValue, FieldDef, FieldDefs, StructLint};

const BAR_FIELD: FieldDef = FieldDef::new("foo", "bar", false, DefaultValue::Bool(None));
const BAZ_FIELD: FieldDef = FieldDef::new("foo", "baz", false, DefaultValue::Str(None));
const FOO_FIELDS: &[&FieldDef] = &[&BAR_FIELD, &BAZ_FIELD];
const FOO_FIELD_DEFS: FieldDefs = FieldDefs::new(FOO_FIELDS);

const FOO_LINT: StructLint = StructLint::new(FieldDefs::empty(), &FOO_FIELD_DEFS);

Implementations

impl<'a> StructLint<'a>[src]

pub const fn new(
    struct_defs: &'a FieldDefs<'a>,
    fields_defs: &'a FieldDefs<'a>
) -> Self
[src]

create a new struct lint

struct_defs lints attribute on the structs itself and fields_defs lints the fields of the struct

Trait Implementations

impl<'_> Lint<DeriveInput> for StructLint<'_>[src]

impl<'_> Lint<ItemStruct> for StructLint<'_>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for StructLint<'a>

impl<'a> !Send for StructLint<'a>

impl<'a> !Sync for StructLint<'a>

impl<'a> Unpin for StructLint<'a>

impl<'a> !UnwindSafe for StructLint<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.