Trait io_lifetimes::FromSocketlike
source · [−]pub trait FromSocketlike: FromFd {
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 FromFd
and Windows’
FromSocket
. It also provides the from_into_socketlike
convenience
function providing simplified from+into conversions.
Required methods
fn from_socketlike(owned: OwnedSocketlike) -> Self
fn from_socketlike(owned: OwnedSocketlike) -> Self
Constructs a new instance of Self
from the given socketlike object.
fn from_into_socketlike<Owned: IntoSocketlike>(owned: Owned) -> Self
fn from_into_socketlike<Owned: IntoSocketlike>(owned: Owned) -> Self
Constructs a new instance of Self
from the given socketlike object
converted from into_owned
.