[][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 RawHandles—mainly files and pipes.

UnsafeHandle

A non-owning unsafe I/O handle.

UnsafeReadable

A non-owning unsafe I/O handle that implements Read. Read functions are considered safe, so this type requires unsafe to construct.

UnsafeSocket

A non-owning unsafe I/O handle which on Windows is limited to handling what Windows considers to be RawSockets—mainly TCP listeners and streams and UDP sockets.

UnsafeWriteable

A non-owning unsafe I/O handle that implements Write. Write functions considered are safe, so this type requires unsafe to construct.

View

A view of a resource which dereferences to a &Target or &mut Target.

Traits

AsRawReadWriteFd

Like std::os::unix::io::AsRawFd, but specifically for use with implementations which may contain both reading and writing file descriptors.

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 AsUnsafeHandle for streams which may have one or two handles, for reading and writing.

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.