[][src]Module show_notes::e031::unions

Demonstrate unions! Combines an enum and a union into a struct that acts mostly like a regular Rust enum.

Structs

Either

Uses an enum and a union to get close to a regular Rust enum.

Wrapped

A simple type designed to demo unions. See the body of demo_union.

Enums

Tag

For tagging the type in Either. See the body of demo_union.

Functions

demo_union

Builds an instance of Either, a manually-managed "tagged union" type.

Unions

EitherValue

A union, to be used as the inner value for Either.