Trait efficient_enum::TaggableValue
[−]
[src]
pub unsafe trait TaggableValue<TaggingMethod, Count: TagOptions> { fn untag(self) -> Self; fn untag_in_place(&mut self); fn get_tag(&self) -> Count::Options; fn change_tag_helper(v: &mut Self, o: Count::Options); fn fmt_untagged(a: &Self, f: &mut Formatter) -> Result where Self: Debug; fn eq(a: &Self, b: &Self) -> bool where Self: PartialEq; fn ne(a: &Self, b: &Self) -> bool where Self: PartialEq; fn tag_helper(v: &mut Self, o: Count::Options) { ... } }
A trait representing a value which can have some space dedicated to use for tagging a union
Required Methods
fn untag(self) -> Self
Untags a value and returns it
fn untag_in_place(&mut self)
Untags a value in place
fn get_tag(&self) -> Count::Options
Get's the tag associated with a value
fn change_tag_helper(v: &mut Self, o: Count::Options)
A helper for changing the tag of a value
fn fmt_untagged(a: &Self, f: &mut Formatter) -> Result where Self: Debug
A helper debug printing a value as though it weren't tagged
fn eq(a: &Self, b: &Self) -> bool where Self: PartialEq
A helper testing equality between tagged items
fn ne(a: &Self, b: &Self) -> bool where Self: PartialEq
A helper testing inequality between tagged items
Provided Methods
fn tag_helper(v: &mut Self, o: Count::Options)
A helper for initializing the tag of a value