PhenotypeDebug

Trait PhenotypeDebug 

Source
pub trait PhenotypeDebug: Phenotype {
    // Required methods
    fn discriminant(&self) -> usize;
    fn debug_tag(tag: usize) -> &'static str;
}
Expand description

Some helpful methods for using Phenotype

Required Methods§

Source

fn discriminant(&self) -> usize

Returns the tag that Phenotype uses internally to identify the enum variant. Note: this is different from the tag the compiler uses or a discriminant that was manually specified. It only has meaning in the context of Phenotype.

Source

fn debug_tag(tag: usize) -> &'static str

Takes a tag and returns a string that represents the variant. For example, it might return something like Result::Ok for 0 and Result::Err for 1 if Phenotype was derived on the Result type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§