Module descriptor

Source
Expand description

Linux file descriptors and file descriptions (equivalent to Linux struct files).

Modules§

descriptor_table
epoll
eventfd
listener
Types for emitting and subscribing to File events.
pipe
shared_buf
A buffer for files that need to share a buffer with other files. Example use-cases are pipes and unix sockets. This buffer supports notifying files when readers or writers are added or removed.
socket
timerfd

Structs§

CountedLegacyFileRef
Represents a counted reference to a legacy file object. Will decrement the legacy file’s ref count when dropped.
Descriptor
A file descriptor that reference an open file. Also contains flags that change the behaviour of this file descriptor.
FileMode
These are flags that should generally not change (analagous to the Linux filp->f_mode). Since the plugin will never see these values and they’re not exposed by the kernel, we don’t match the kernel FMODE_ values here.
FileSignals
File-related signals that listeners can watch for.
FileState
Flags representing the state of a file. Listeners can subscribe to state changes using FileRefMut::add_listener (or similar methods on SocketRefMut, Pipe, etc).
FileStatus
These are flags that can potentially be changed from the plugin (analagous to the Linux filp->f_flags status flags). Not all O_ flags are valid here. For example file access mode flags (ex: O_RDWR) are stored elsewhere, and file creation flags (ex: O_CREAT) are not stored anywhere. Many of these can be represented in different ways, for example: O_NONBLOCK, SOCK_NONBLOCK, EFD_NONBLOCK, GRND_NONBLOCK, etc, and not all have the same value.
LegacyFileCounter
Used to track how many descriptors are open for a LegacyFile.
OpenFile
Represents a POSIX file description, or a Linux struct file.

Enums§

CompatFile
A compatibility wrapper around an OpenFile or LegacyFileCounter.
File
A wrapper for any type of file object.
FileRef
Wraps an immutably borrowed File. Created from File::borrow or File::try_borrow.
FileRefMut
Wraps a mutably borrowed File. Created from File::borrow_mut or File::try_borrow_mut.