Skip to main content

virtual_file_system/
lib.rs

1#![no_std]
2
3extern crate alloc;
4
5mod cursor;
6mod directory;
7mod error;
8mod file;
9mod file_system;
10mod hierarchy;
11mod home;
12mod item;
13mod r#macro;
14mod operation;
15mod pipe;
16mod readiness;
17mod synchronous_directory;
18mod synchronous_file;
19
20pub use directory::*;
21pub use error::*;
22use exported_file_system::Flags;
23pub use file::*;
24pub use file_system::*;
25pub use hierarchy::*;
26pub use item::*;
27pub use pipe::PIPE_BUF;
28pub use readiness::*;
29pub use synchronous_directory::*;
30pub use synchronous_file::*;
31
32pub extern crate file_system as exported_file_system;
33
34/// Run synchronous metadata once. Busy is an error, not an implicit wait.
35pub async fn poll<O>(operation: impl FnOnce() -> Result<O>) -> Result<O> {
36    operation()
37}
38
39pub fn blocking_operation<O>(_flags: Flags, operation: impl FnOnce() -> Result<O>) -> Result<O> {
40    operation()
41}
42
43#[cfg(any(
44    all(
45        any(target_arch = "x86_64", target_arch = "aarch64"),
46        target_os = "linux"
47    ),
48    all(
49        any(
50            target_arch = "x86_64",
51            target_arch = "aarch64",
52            target_arch = "arm",
53            target_arch = "riscv32",
54            target_arch = "xtensa"
55        ),
56        target_os = "none"
57    )
58))]
59use stackful::{suspend_on, suspend_on_cancellable};
60
61#[cfg(not(any(
62    all(
63        any(target_arch = "x86_64", target_arch = "aarch64"),
64        target_os = "linux"
65    ),
66    all(
67        any(
68            target_arch = "x86_64",
69            target_arch = "aarch64",
70            target_arch = "arm",
71            target_arch = "riscv32",
72            target_arch = "xtensa"
73        ),
74        target_os = "none"
75    )
76)))]
77use task::{block_on as suspend_on, block_on as suspend_on_cancellable};