[−][src]Struct macro_input_core::StructLint
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]
struct_defs: &'a FieldDefs<'a>,
fields_defs: &'a FieldDefs<'a>
) -> Self
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]
fn lint(&self, input: &DeriveInput, c: &mut Collector)
[src]
impl<'_> Lint<ItemStruct> for StructLint<'_>
[src]
fn lint(&self, input: &ItemStruct, c: &mut Collector)
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,