[][src]Crate filedescriptor

The purpose of this crate is to make it a bit more ergonomic for portable applications that need to work with the platform level RawFd and RawHandle types. Rather than conditionally using RawFd and RawHandle, the FileDescriptor type can be used to manage ownership, duplicate, read and write. The Pipe type makes it more convenient to create a pipe and manage the lifetime of both the read and write ends of that pipe.

Structs

FileDescriptor

FileDescriptor is a thin wrapper on top of the OwnedHandle type that exposes the ability to Read and Write to the platform RawFileDescriptor.

OwnedHandle

OwnedHandle allows managing the lifetime of the platform RawFileDescriptor type. It is exposed in the interface of this crate primarily for convenience on Windows where the system handle type is used for a variety of objects that don't support reading and writing.

Pipe

Represents the readable and writable ends of a pair of descriptors connected via a kernel pipe.

Traits

AsRawFileDescriptor

AsRawFileDescriptor is a platform independent trait for returning a non-owning reference to the underlying platform file descriptor type.

FromRawFileDescriptor

FromRawFileDescriptor is a platform independent trait for creating an instance from the underlying platform file descriptor type. Because the platform file descriptor type has no inherent ownership management, the from_raw_file_descrptor function is marked as unsafe to indicate that care must be taken by the caller to ensure that it is used appropriately.

IntoRawFileDescriptor

IntoRawFileDescriptor is a platform independent trait for converting an instance into the underlying platform file descriptor type.

Type Definitions

RawFileDescriptor

RawFileDescriptor is a platform independent type alias for the underlying platform file descriptor type. It is primarily useful for avoiding using cfg blocks in platform independent code.