Trait io_lifetimes::FromSocketlike
source · pub trait FromSocketlike: From<OwnedFd> {
// 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<OwnedSocketFrom<OwnedSocket>
It also provides the
from_into_socketlike
convenience function providing simplified from+into
conversions.
Required Methods§
sourcefn from_socketlike(owned: OwnedSocketlike) -> Self
fn from_socketlike(owned: OwnedSocketlike) -> Self
Constructs a new instance of Self
from the given socketlike object.
sourcefn 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
.
Object Safety§
This trait is not object safe.