1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Async file I/O primitives for Moirai concurrency library.
//!
//! File-system syscalls have no readiness model: they block the calling thread
//! on every platform this crate serves. Every operation here therefore runs on
//! a bounded file-system blocking pool, never
//! inside `poll`, so a slow disk or network mount stalls a pool worker, not the
//! executor, and a dropped future can be cancelled.
use OnceLock;
use crateBlockingPool;
/// Async file handle and open/create entry points.
/// Free-function file operations (read, write, copy, remove).
/// File-operation statistics counters.
pub use File;
pub use FileOpenOptions;
pub use ;
pub use FileStats;
/// File-system worker threads for the whole process.
///
/// A file syscall holds its worker for one device round trip. That is
/// microseconds on local storage, and up to the server's timeout on a network
/// mount. Four workers bound the threads that a stalled mount can pin, and
/// leave three serving while one hangs. Operations past the bound wait
/// asynchronously for admission, which costs no thread.
pub const FS_WORKERS: usize = 4;
/// Admitted operations that may wait in the queue behind the running ones:
/// one per worker, so each worker takes its next job without a round trip
/// through admission.
pub const FS_QUEUE_DEPTH: usize = FS_WORKERS;
/// The process-wide file-system pool; its workers run for the process
/// lifetime (see the worker-lifetime section of `blocking`).
pub