Struct bounded_integer_plugin::IntegerEnum [] [src]

pub struct IntegerEnum {
    pub attrs: Vec<Attribute>,
    pub is_pub: bool,
    pub name: Ident,
    pub repr: Ident,
    pub min: P<Expr>,
    pub max: P<Expr>,
}

Parsed bounded integer enum.

Fields

attrs: Vec<Attribute>

Attributes.

is_pub: bool

Visibility.

name: Ident

Name.

repr: Ident

Representation.

min: P<Expr>

Minimum value.

max: P<Expr>

Maximum value.

Methods

impl IntegerEnum
[src]

fn parse_tts<'a>(cx: &'a ExtCtxt, tts: &[TokenTree]) -> Result<Self, DiagnosticBuilder<'a>>

Parses a slice of token trees.

Roughly equivalent to:

$(#[$attr:meta])*
$(pub)? enum $name:ident: $repr:ident { $min:expr...$max:expr }

fn into_items(self, cx: &ExtCtxt, sp: Span) -> Vec<P<Item>>

Creates an enum item and a bounded_integer_impls macro invocation item.

  • Adds #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
  • Adds #[repr($repr)]
  • Generates variants of the form ...N1, Z0, P1....
  • Sets item visibility.
  • Invokes bounded_integer_impls! macro.

Trait Implementations

Derived Implementations

impl Debug for IntegerEnum
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.