Crate efficient_enum [] [src]

Space-efficient enum values.

For the moment only option types are implemented, as true enums would require something like a const fn version of size_of.

Structs

EfficientOption

An option type similar to Option<A>, but where no extra data is used. Instead, some of the space in A is used to "tag the union".

EfficientOptionTuple

An option type similar to (A, Option<B>), but where no extra data is used. Instead, some of the space in A is used to "tag the union".

TagMSB

A struct represnting the method of tagging using only the MSB of a number

Two

A struct for representing enums with 2 options

Enums

TwoOptions

An enum with 2 options

Traits

TagOptions

A trait for getting the number of options associated with a TaggableValue of a specific size

TaggableValue

A trait representing a value which can have some space dedicated to use for tagging a union