cgp-field 0.8.0-alpha

A language extension for Rust, with pluggable trait implementations at compile-time.
Documentation
1
2
3
4
5
6
7
use core::marker::PhantomData;

pub trait FromVariant<Tag> {
    type Value;

    fn from_variant(_tag: PhantomData<Tag>, value: Self::Value) -> Self;
}