Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Possible scheme fields improvement

Abierto
#208 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
backend

Línea de trabajo

Start with the README example using Scheme!, get_field, and set_field_value, then read the scheme and field APIs that define how field references are created and checked. Explore whether compile-time field information can provide a non-optional FieldRef while preventing values from unrelated schemes from being passed. Done means the API addresses both concerns; the issue names no tests, so identify relevant coverage while reading the implementation.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I noticed the readme example has a few unwraps that could probably be avoided. For example:


let scheme = Scheme! {
    http.method: Bytes,
    http.ua: Bytes,
    port: Int,
}
.build();

// ...

ctx.set_field_value(scheme.get_field("http.method").unwrap(), "GET")?;

I played around a bit to see if the field information could be returned when defining the scheme. That information could then be used to get a non-optional FieldRef based on the fact we know such fields were defined at compile time. I created a fork to demonstrate the idea: https://github.com/tombailey/wirefilter/pull/1

Just to note, that fork is AI slop. It is not intended as a real patch

And the fork doesn't prevent set_field_value being called with a field from an unrelated scheme

Lenguaje dominante
Rust
Estrellas
1.2k
Forks
126
Merge medio
12 h 12 min
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudflare/wirefilter

Todos los issues de cloudflare/wirefilter

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.