pub trait FromSocket {
// Required method
fn from_socket(owned: OwnedSocket) -> Self;
// Provided method
fn from_into_socket<Owned: Into<OwnedSocket>>(into_owned: Owned) -> Self
where Self: Sized + From<OwnedSocket> { ... }
}
Expand description
A trait to express the ability to construct an object from a socket.
Required Methods§
Sourcefn from_socket(owned: OwnedSocket) -> Self
👎Deprecated since 1.0.0: FromSocket::from_socket
is replaced by From<OwnedSocket>::from
fn from_socket(owned: OwnedSocket) -> Self
FromSocket::from_socket
is replaced by From<OwnedSocket>::from
Constructs a new instance of Self
from the given socket.
Provided Methods§
Sourcefn from_into_socket<Owned: Into<OwnedSocket>>(into_owned: Owned) -> Self
fn from_into_socket<Owned: Into<OwnedSocket>>(into_owned: Owned) -> Self
Constructs a new instance of Self
from the given socket 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.