Possible scheme fields improvement
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudflare/wirefilter
-
AlwaysListMatcher::match_value always returns false, contradicting its own doc commentForse già presa @sean0407 l’ha presa 11 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
cloudflare/wirefilter#190 ·
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 32/100
cloudflare/wirefilter#204 · 2 commenti ·
-
CPrimitiveType (a repr(u8) enum) is received directly by value across the C ABI with no validationAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
cloudflare/wirefilter#196 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
cloudflare/wirefilter#195 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
cloudflare/wirefilter#194 ·
Tutte le issue di cloudflare/wirefilter
Issue simili
-
spurctld: a user with no usage gets a lower fair-share factor than a user with a little usageAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
area:ci kind:bug priority:p3 ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
srikanth235/centraid#1155 ·
I maintainer di solito rispondono entro 1 giorno
-
dotfiles: failed batch untrack removes earlier tracking declarationsForse già presa @jdx l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni