AldaronLau / AldaronLau/as_repr

idea: Newtype wrapper for open enums

Abierto
#5 0 comentarios 0 reacciones 0 asignados Ver en GitHub
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

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.