Trait unsafe_io::FromUnsafeSocket [−][src]
pub trait FromUnsafeSocket {
unsafe fn from_unsafe_socket(unsafe_socket: UnsafeSocket) -> Self;
fn from_socketlike<Socketlike: IntoUnsafeSocket>(
socketlike: Socketlike
) -> Self
where
Self: Sized,
{ ... }
}
Expand description
A trait for types which can be constructed from unsafe sockets.
Required methods
unsafe fn from_unsafe_socket(unsafe_socket: UnsafeSocket) -> Self
unsafe fn from_unsafe_socket(unsafe_socket: UnsafeSocket) -> Self
Convert an unsafe socket into a Self
.
Safety
The return value of this function may be used to dereference the given unsafe handle without using unsafe, so the caller must ensure that it doesn’t outlive the underlying resource.
Provided methods
fn from_socketlike<Socketlike: IntoUnsafeSocket>(socketlike: Socketlike) -> Self where
Self: Sized,
fn from_socketlike<Socketlike: IntoUnsafeSocket>(socketlike: Socketlike) -> Self where
Self: Sized,
Convert from a type which implements IntoUnsafeSocket
into a type
that implements FromUnsafeSocket
.