Expand description
Platform Abstraction Layer (PAL) for Moirai async I/O operations.
This module provides platform-specific implementations of async I/O primitives that enable true non-blocking operations without external runtime dependencies.
§Architecture
The PAL provides a unified interface across platforms while leveraging optimal platform-specific async I/O mechanisms:
- Linux: epoll-based event notification
- macOS/BSD: kqueue-based event notification
- Windows:
WSAPoll-based socket readiness polling - WebAssembly: Web APIs with JavaScript interop
The Windows PAL can expose a thread-affine WebView2 host for packaged
HTML/CSS/WebAssembly surfaces when the opt-in webview2 feature is enabled.
Its URI, message and wait bounds are owned by the Rust provider; the
installed WebView2 runtime remains a system prerequisite.
§Design Principles
- Zero External Dependencies: Only platform system libraries
- Zero-Copy Operations: Direct buffer management
- Sub-microsecond Latency: Optimized for performance-critical applications
- Memory Efficiency: Minimal per-operation overhead
- Cross-Platform Consistency: Uniform behavior across all targets
Modules§
- fs
- Platform file-system primitives.
- instance
- Single-instance coordination between processes of one application.
- net
- Platform-agnostic async network I/O operations.
- reactor
- Central fd-readiness reactor over the platform backends.
- thread
- Errors from starting the runtime’s own helper threads.
- timer
- Platform-agnostic timer and timeout operations.
- unix
- Unix platform implementations for async I/O.
Structs§
Traits§
- Reactor
- Platform-specific reactor interface.
Functions§
- create_
reactor - Platform-specific reactor factory.
Type Aliases§
- Platform
Reactor - Reactor implementation selected by the compile target.
- RawFd
- Platform-agnostic file descriptor/handle type.