[−][src]Struct macro_input::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>
) -> StructLint<'a>
[src]
struct_defs: &'a FieldDefs<'a>,
fields_defs: &'a FieldDefs<'a>
) -> StructLint<'a>
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]
pub fn lint(&self, input: &DeriveInput, c: &mut Collector)
[src]
impl<'_> Lint<ItemStruct> for StructLint<'_>
[src]
pub fn lint(&self, input: &ItemStruct, c: &mut Collector)
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for StructLint<'a>
[src]
impl<'a> !Send for StructLint<'a>
[src]
impl<'a> !Sync for StructLint<'a>
[src]
impl<'a> Unpin for StructLint<'a>
[src]
impl<'a> UnwindSafe for StructLint<'a>
[src]
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,
pub 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.
pub 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>,