Trait efficient_enum::tag::TaggableValue [] [src]

pub unsafe trait TaggableValue<TM, Count: TagOptions> {
    fn untag(v: TagWrapper<Self, TM>) -> Self;
    fn untag_in_place(v: &mut TagWrapper<Self, TM>);
    fn get_tag(v: &TagWrapper<Self, TM>) -> Count;
    fn tag(v: Self, o: Count) -> TagWrapper<Self, TM>;
    fn tag_in_place(v: &mut TagWrapper<Self, TM>, o: Count);
    fn change_tag(v: &mut TagWrapper<Self, TM>, o: Count);
    unsafe fn uninitialized_from_tag(o: Count) -> TagWrapper<Self, TM>;
    fn fmt_untagged(v: &TagWrapper<Self, TM>, f: &mut Formatter) -> Result
    where
        Self: Debug
; fn eq(a: &TagWrapper<Self, TM>, b: &TagWrapper<Self, TM>) -> bool
    where
        Self: PartialEq
; fn ne(a: &TagWrapper<Self, TM>, b: &TagWrapper<Self, TM>) -> bool
    where
        Self: PartialEq
; }

A trait representing a value which can have some space dedicated to use for tagging a union If you implement this trait incorrectly, you will break memory safety.

Required Methods

Untags a value and returns it

Untags a value in place

Gets the tag associated with a value

Tag a value and return it

Tag a value in place

Change the tag on an already tagged value

Return a tagged (but otherwise uninitialized) value

A helper debug printing a value as though it weren't tagged

A helper testing equality between tagged items

A helper testing inequality between tagged items

Implementors