pnet_macros: infallible new/owned possible with const generics?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
Hi, could const generics be used to make a version of new / owned that can't return None?
It feels weird to me that if I make a buffer of size MutableIpv4Packet::minimum_packet_size() and then let packet = MutableIpv4Packet::owned(that buffer), this requires an unwrap because we can't be sure that the buffer is big enough to hold the minimum packet size.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the pnet_macros implementations and the MutableIpv4Packet::new, owned, and minimum_packet_size entry points mentioned in the issue. Determine whether const generics can guarantee a sufficient buffer size without returning None, and define the expected API behavior before evaluating the change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100