aral_runtime_noop/fs/
mod.rs

1use crate::io::{Read, Seek, Write};
2use std::{
3    fs::{Metadata, Permissions},
4    io::{Result, SeekFrom},
5    path::{Path, PathBuf},
6};
7
8pub struct File;
9
10impl File {
11    #[inline]
12    pub async fn create(_path: impl AsRef<Path>) -> Result<File> {
13        no_runtime_specified!();
14    }
15
16    #[inline]
17    pub async fn open(_path: impl AsRef<Path>) -> Result<File> {
18        no_runtime_specified!();
19    }
20
21    #[inline]
22    pub async fn metadata(&self) -> Result<Metadata> {
23        no_runtime_specified!();
24    }
25
26    #[inline]
27    pub async fn set_len(&self, _size: u64) -> Result<()> {
28        no_runtime_specified!();
29    }
30
31    #[inline]
32    pub async fn set_permissions(&self, _perm: Permissions) -> Result<()> {
33        no_runtime_specified!();
34    }
35
36    #[inline]
37    pub async fn sync_all(&self) -> Result<()> {
38        no_runtime_specified!();
39    }
40
41    #[inline]
42    pub async fn sync_data(&self) -> Result<()> {
43        no_runtime_specified!();
44    }
45
46    #[inline]
47    pub async fn try_clone(&self) -> Result<File> {
48        no_runtime_specified!();
49    }
50}
51
52impl Read for File {
53    #[inline]
54    async fn read(&mut self, _buf: &mut [u8]) -> Result<usize> {
55        no_runtime_specified!();
56    }
57}
58
59impl Write for File {
60    #[inline]
61    async fn write(&mut self, _buf: &[u8]) -> Result<usize> {
62        no_runtime_specified!();
63    }
64
65    #[inline]
66    async fn flush(&mut self) -> Result<()> {
67        no_runtime_specified!();
68    }
69}
70
71impl Seek for File {
72    #[inline]
73    async fn seek(&mut self, _pos: SeekFrom) -> Result<u64> {
74        no_runtime_specified!();
75    }
76}
77
78pub struct OpenOptions;
79
80impl OpenOptions {
81    #[inline]
82    pub fn append(&mut self, _append: bool) -> &mut OpenOptions {
83        no_runtime_specified!();
84    }
85
86    #[inline]
87    pub fn create(&mut self, _create: bool) -> &mut OpenOptions {
88        no_runtime_specified!();
89    }
90
91    #[inline]
92    pub fn create_new(&mut self, _create_new: bool) -> &mut OpenOptions {
93        no_runtime_specified!();
94    }
95
96    #[inline]
97    pub fn new() -> OpenOptions {
98        no_runtime_specified!();
99    }
100
101    #[inline]
102    pub async fn open(&self, _path: impl AsRef<Path>) -> Result<File> {
103        no_runtime_specified!();
104    }
105
106    #[inline]
107    pub fn read(&mut self, _read: bool) -> &mut OpenOptions {
108        no_runtime_specified!();
109    }
110
111    #[inline]
112    pub fn truncate(&mut self, _truncate: bool) -> &mut OpenOptions {
113        no_runtime_specified!();
114    }
115
116    #[inline]
117    pub fn write(&mut self, _write: bool) -> &mut OpenOptions {
118        no_runtime_specified!();
119    }
120}
121
122impl Default for OpenOptions {
123    #[inline]
124    fn default() -> Self {
125        Self::new()
126    }
127}
128
129#[inline]
130pub async fn canonicalize(_path: impl AsRef<Path>) -> Result<PathBuf> {
131    no_runtime_specified!();
132}
133
134#[inline]
135pub async fn copy(_from: impl AsRef<Path>, _to: impl AsRef<Path>) -> Result<u64> {
136    no_runtime_specified!();
137}
138
139#[inline]
140pub async fn create_dir(_path: impl AsRef<Path>) -> Result<()> {
141    no_runtime_specified!();
142}
143
144#[inline]
145pub async fn create_dir_all(_path: impl AsRef<Path>) -> Result<()> {
146    no_runtime_specified!();
147}
148
149#[inline]
150pub async fn hard_link(_src: impl AsRef<Path>, _dst: impl AsRef<Path>) -> Result<()> {
151    no_runtime_specified!();
152}
153
154#[inline]
155pub async fn metadata(_path: impl AsRef<Path>) -> Result<Metadata> {
156    no_runtime_specified!();
157}
158
159#[inline]
160pub async fn read(_path: impl AsRef<Path>) -> Result<Vec<u8>> {
161    no_runtime_specified!();
162}
163
164#[inline]
165pub async fn read_link(_path: impl AsRef<Path>) -> Result<PathBuf> {
166    no_runtime_specified!();
167}
168
169#[inline]
170pub async fn read_to_string(_path: impl AsRef<Path>) -> Result<String> {
171    no_runtime_specified!();
172}
173
174#[inline]
175pub async fn remove_dir(_path: impl AsRef<Path>) -> Result<()> {
176    no_runtime_specified!();
177}
178
179#[inline]
180pub async fn remove_dir_all(_path: impl AsRef<Path>) -> Result<()> {
181    no_runtime_specified!();
182}
183
184#[inline]
185pub async fn remove_file(_path: impl AsRef<Path>) -> Result<()> {
186    no_runtime_specified!();
187}
188
189#[inline]
190pub async fn rename(_from: impl AsRef<Path>, _to: impl AsRef<Path>) -> Result<()> {
191    no_runtime_specified!();
192}
193
194#[inline]
195pub async fn set_permissions(_path: impl AsRef<Path>, _perm: Permissions) -> Result<()> {
196    no_runtime_specified!();
197}
198
199#[inline]
200pub async fn symlink_metadata(_path: impl AsRef<Path>) -> Result<Metadata> {
201    no_runtime_specified!();
202}
203
204#[inline]
205pub async fn write(_path: impl AsRef<Path>, _contents: impl AsRef<[u8]>) -> Result<()> {
206    no_runtime_specified!();
207}