Skip to content

pnet_macros: infallible new/owned possible with const generics? #718

@tz18

Description

@tz18

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions