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 :).
Is there any way to create a new copy of a
SockAddrfrom 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_storageandsocklen_thave bothCopyandClonetraits implemented for them, and in its current formSockAddris 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 addCopy/Clonetraits toSockAddr. I would be happy to help out with implementing something like this if wanted :).