AldaronLau / AldaronLau/as_repr
idea: Newtype wrapper for open enums
Abierto
- Lenguaje dominante
- Rust
- Estrellas
- 1
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
`AsReprInherent` creates the possibility of a newtype adapter to create an open type (all bit patterns valid) from a closed type (some bit patterns invalid):
```rust
#[repr(transparent)]
pub struct Open(pub T::InherentRepr)
where
T: AsReprInherent,
::InherentRepr: Integer;
```
Could automatically get `TryFrom> for T where T: TryFromRepr {}` and `From for Open where T: ReprFrom`
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.