[][src]Struct macro_input::FieldDefs

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

FieldDefs is a collection of FieldDefs

Example

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

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);

Implementations

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

pub const fn new(defs: &'a [&'a FieldDef<'a>]) -> FieldDefs<'a>[src]

create a new collection of FieldDefs from a slice

pub const fn empty() -> &'static FieldDefs<'static>[src]

return an empty collection of FieldDefs

pub fn strip(&self, attrs: &mut Vec<Attribute, Global>)[src]

strip the attributes for all field away

Trait Implementations

impl<'a> From<&'a [&'a FieldDef<'a>]> for FieldDefs<'a>[src]

impl<'_> Lint<Vec<Attribute, Global>> for FieldDefs<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for FieldDefs<'a>[src]

impl<'a> !Send for FieldDefs<'a>[src]

impl<'a> !Sync for FieldDefs<'a>[src]

impl<'a> Unpin for FieldDefs<'a>[src]

impl<'a> UnwindSafe for FieldDefs<'a>[src]

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.