cgp-field 0.8.0-alpha

A language extension for Rust, with pluggable trait implementations at compile-time.
Documentation
use crate::traits::MapType;
use crate::types::Void;

pub struct IsPresent;

impl MapType for IsPresent {
    type Map<T> = T;
}

pub struct IsNothing;

impl MapType for IsNothing {
    type Map<T> = ();
}

pub struct IsVoid;

impl MapType for IsVoid {
    type Map<T> = Void;
}

pub struct IsOptional;

impl MapType for IsOptional {
    type Map<T> = Option<T>;
}