[−][src]Crate unsafe_io
Non-owning unsafe I/O
A brief explanation of the naming convention:
Raw
is for platform-specific types, such as std
's RawFd
,
AsRawFd
, RawHandle
, AsRawHandle
, and similar, as well as
unsafe-io
's RawHandleOrSocket
, AsRawHandleOrSocket
, and similar.
Handle
in this context means a Windows HANDLE
.
Unsafe
is for (mostly) platform-independent abstractions on top of the
platform-specific types, such as UnsafeHandle
(abstracts over RawFd
and RawHandleOrSocket
), UnsafeFile
(abstracts over RawFd
and
RawHandle
), and [UnsafeSocket
] (abstracts over RawFd
and RawSocket
).
UnsafeReadable
and UnsafeWriteable
are similar to UnsafeHandle
,
but require unsafe
to construct, so that they can safely implement Read
and Write
. Handle
in this context means a value representing an open
I/O resource.
ReadWrite
describes types which support both Read
and Write
and may
contain either one or two handles.
Structs
UnsafeFile | A non-owning unsafe I/O handle which on Windows is limited to handling what
Windows considers to be |
UnsafeHandle | A non-owning unsafe I/O handle. |
UnsafeReadable | A non-owning unsafe I/O handle that implements |
UnsafeSocket | A non-owning unsafe I/O handle which on Windows is limited to handling what
Windows considers to be |
UnsafeWriteable | A non-owning unsafe I/O handle that implements |
View | A view of a resource which dereferences to a |
Traits
AsRawReadWriteFd | Like |
AsUnsafeFile | A trait for types which contain an unsafe file and can expose it. |
AsUnsafeHandle | A trait for types which contain an unsafe handle and can expose it. |
AsUnsafeReadWriteHandle | An analog of |
AsUnsafeSocket | A trait for types which contain an unsafe socket and can expose it. |
FromUnsafeFile | A trait for types which can be constructed from unsafe files. |
FromUnsafeSocket | A trait for types which can be constructed from unsafe sockets. |
IntoUnsafeFile | A trait for types which can be converted into unsafe files. |
IntoUnsafeHandle | A trait for types which can be converted into an unsafe handle. |
IntoUnsafeSocket | A trait for types which can be converted into unsafe sockets. |