Enum macrohelper::bodykind::structure::Structure [] [src]

pub enum Structure {
    NormalStruct(Fields),
    TupleStruct(Fields),
    Unit,
    Discriminant(Lit),
}

There are multiple types of structures in Rust.

Variants

The normal structure which has several fields

Example: pub struct AStruct{ a: u64, b: u64 }

A tuple struct which is just a named tuple

Example: pub struct AStruct( u64, u64);

A structure that contains no data

Example: pub struct ZeroSizedStruct;

Literal Value

A structure cannot actually be this type. But Enum's as they can be declared with a constant value.

Methods

impl Structure
[src]

Build a structure from syn's representation

Build a structure from syn's representation

Build from syn's Body representation

Get Fields

Returns Fields if this Struct is a Tuple or Normal

Get Literal

Returns the literal value if this is a Discrimninat structure

Get From Literal

Pre-Perform the conversion

Trait Implementations

impl Clone for Structure
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Structure
[src]

Formats the value using the given formatter.