Skip to main content

Module sys

Module sys 

Source
Expand description

Platform-specific I/O primitives.

Provides a thin, cross-platform surface over OS I/O handles, interest flags, and event types. Unix uses libc raw file descriptors; Windows stubs use windows-sys HANDLE types.

Structs§

Event
A single I/O readiness event returned from a poll call.
Interest
Bitmask describing which I/O events a source is interested in.

Functions§

close_fd
Close a file descriptor.
create_pipe
Create an OS pipe and return (read_fd, write_fd).
events_with_capacity
Create a fresh Events buffer with the given capacity pre-allocated.
set_nonblocking
Set a file descriptor to non-blocking mode.

Type Aliases§

Events
Collection of events returned from a single poll call. Pre-allocated with a reasonable default capacity to avoid realloc on the hot path.
RawSource
Raw I/O handle type.