Skip to content

e-nal-async: Missing lifetimes in UdpStack #103

@ivmarkov

Description

@ivmarkov

Connected, UniquelyBound and MultiplyBound associated types are currently not lifetimed.

I need them to be, so that I can keep a non-mutable reference to the "Udp Stack" instance in their impls.
While I can Arc the "Udp Stack" and then push the arc into the UDP socket impl, this just doesn't feel right.

Perhaps it is no coincidence that embassy-net's UDP socket stack is not implementing the e-nal-async traits? I don't think it would be possible anyway, without the above lifetimes.

Background: I stumbled on this by accident, while trying to implement a toy websockets gateway that tries to implement embedded-nal-async traits by multiplexing all traffic (UDP and TCP) over a single websocket to an actual STD based embedded-nal-async impl.

Anyway, I'll also work on a PR that implements a lifetimed version of the UDP associated types on top of embassy-net.

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