Struct SockAddrStorage

struct SockAddrStorage { ... }

Rust version of the sockaddr_storage type.

This type is intended to be used with with direct calls to the getsockname syscall. See the documentation of SockAddr::new for examples.

This crate defines its own sockaddr_storage type to avoid semver concerns with upgrading windows-sys.

Implementations

impl SockAddrStorage

fn zeroed() -> Self

Construct a new storage containing all zeros.

fn size_of(self: &Self) -> socklen_t

Returns the size of this storage.

unsafe fn view_as<T>(self: &mut Self) -> &mut T

View this type as another type.

Safety

The type T must be one of the sockaddr_* types defined by this platform.

impl Debug for SockAddrStorage

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Freeze for SockAddrStorage

impl RefUnwindSafe for SockAddrStorage

impl Send for SockAddrStorage

impl Sync for SockAddrStorage

impl Unpin for SockAddrStorage

impl UnsafeUnpin for SockAddrStorage

impl UnwindSafe for SockAddrStorage

impl<T> Any for SockAddrStorage

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for SockAddrStorage

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for SockAddrStorage

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for SockAddrStorage

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for SockAddrStorage

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for SockAddrStorage

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for SockAddrStorage

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>