pub trait FromSocketlike: From<OwnedSocket> {
    // Required methods
    fn from_socketlike(owned: OwnedSocketlike) -> Self;
    fn from_into_socketlike<Owned: IntoSocketlike>(owned: Owned) -> Self;
}
Expand description

A portable trait to express the ability to construct an object from a socketlike object.

This is a portability abstraction over Unix-like From<OwnedFd> and Windows’ From<OwnedSocket>. It also provides the from_into_socketlike convenience function providing simplified from+into conversions.

Required Methods§

source

fn from_socketlike(owned: OwnedSocketlike) -> Self

Constructs a new instance of Self from the given socketlike object.

source

fn from_into_socketlike<Owned: IntoSocketlike>(owned: Owned) -> Self

Constructs a new instance of Self from the given socketlike object converted from into_owned.

Object Safety§

This trait is not object safe.

Implementors§