Skip to content

API to clone/copy a SockAddr? #310

@nathaniel-bennett

Description

@nathaniel-bennett

Is there any way to create a new copy of a SockAddr from an existing one? I've searched through documentation pretty extensively, but there doesn't appear to be any API to do it as it stands.

It looks like sockaddr_storage and socklen_t have both Copy and Clone traits implemented for them, and in its current form SockAddr is composed of just those two values, so unless there's some compatibility reason for not adding them it seems like it would be pretty straightforward to add Copy/Clone traits to SockAddr. I would be happy to help out with implementing something like this if wanted :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions