pub trait FromRawHandleOrSocket {
// Required method
unsafe fn from_raw_handle_or_socket(
raw_handle_or_socket: RawHandleOrSocket,
) -> Self;
}
Expand description
Like FromRawHandle
and FromRawSocket
, but implementable by types
which can implement both.
Note: Don’t implement this trait for types which can only implement one or the other, such that it would need to panic if passed the wrong form.
Required Methods§
Sourceunsafe fn from_raw_handle_or_socket(
raw_handle_or_socket: RawHandleOrSocket,
) -> Self
unsafe fn from_raw_handle_or_socket( raw_handle_or_socket: RawHandleOrSocket, ) -> Self
Like FromRawHandle::from_raw_handle
and
FromRawSocket::from_raw_socket
but can be passed either type.
§Safety
raw_handle_or_socket
must be valid and otherwise unowned.
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.
Implementors§
impl FromRawHandleOrSocket for RawReadable
RawReadable
doesn’t own its handle.
impl FromRawHandleOrSocket for RawWriteable
RawWriteable
doesn’t own its handle.