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§
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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.