Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Possible scheme fields improvement

Aperta
#208 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Rust
Stelle
1.2k
Fork
126
Merge medio
12h 12m
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/wirefilter

Tutte le issue di cloudflare/wirefilter

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.