std/sys/fs/
unsupported.rs1use crate::ffi::OsString;
2use crate::fmt;
3use crate::fs::TryLockError;
4use crate::hash::{Hash, Hasher};
5use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, SeekFrom};
6use crate::path::{Path, PathBuf};
7use crate::sys::time::SystemTime;
8use crate::sys::unsupported;
9
10pub struct File(!);
11
12pub struct FileAttr(!);
13
14pub struct ReadDir(!);
15
16pub struct DirEntry(!);
17
18#[derive(Clone, Debug)]
19pub struct OpenOptions {}
20
21#[derive(Copy, Clone, Debug, Default)]
22pub struct FileTimes {}
23
24pub struct FilePermissions(!);
25
26pub struct FileType(!);
27
28#[derive(Debug)]
29pub struct DirBuilder {}
30
31impl FileAttr {
32 pub fn size(&self) -> u64 {
33 self.0
34 }
35
36 pub fn perm(&self) -> FilePermissions {
37 self.0
38 }
39
40 pub fn file_type(&self) -> FileType {
41 self.0
42 }
43
44 pub fn modified(&self) -> io::Result<SystemTime> {
45 self.0
46 }
47
48 pub fn accessed(&self) -> io::Result<SystemTime> {
49 self.0
50 }
51
52 pub fn created(&self) -> io::Result<SystemTime> {
53 self.0
54 }
55}
56
57impl Clone for FileAttr {
58 fn clone(&self) -> FileAttr {
59 self.0
60 }
61}
62
63impl FilePermissions {
64 pub fn readonly(&self) -> bool {
65 self.0
66 }
67
68 pub fn set_readonly(&mut self, _readonly: bool) {
69 self.0
70 }
71}
72
73impl Clone for FilePermissions {
74 fn clone(&self) -> FilePermissions {
75 self.0
76 }
77}
78
79impl PartialEq for FilePermissions {
80 fn eq(&self, _other: &FilePermissions) -> bool {
81 self.0
82 }
83}
84
85impl Eq for FilePermissions {}
86
87impl fmt::Debug for FilePermissions {
88 fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
89 self.0
90 }
91}
92
93impl FileTimes {
94 pub fn set_accessed(&mut self, _t: SystemTime) {}
95 pub fn set_modified(&mut self, _t: SystemTime) {}
96}
97
98impl FileType {
99 pub fn is_dir(&self) -> bool {
100 self.0
101 }
102
103 pub fn is_file(&self) -> bool {
104 self.0
105 }
106
107 pub fn is_symlink(&self) -> bool {
108 self.0
109 }
110}
111
112impl Clone for FileType {
113 fn clone(&self) -> FileType {
114 self.0
115 }
116}
117
118impl Copy for FileType {}
119
120impl PartialEq for FileType {
121 fn eq(&self, _other: &FileType) -> bool {
122 self.0
123 }
124}
125
126impl Eq for FileType {}
127
128impl Hash for FileType {
129 fn hash<H: Hasher>(&self, _h: &mut H) {
130 self.0
131 }
132}
133
134impl fmt::Debug for FileType {
135 fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
136 self.0
137 }
138}
139
140impl fmt::Debug for ReadDir {
141 fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
142 self.0
143 }
144}
145
146impl Iterator for ReadDir {
147 type Item = io::Result<DirEntry>;
148
149 fn next(&mut self) -> Option<io::Result<DirEntry>> {
150 self.0
151 }
152}
153
154impl DirEntry {
155 pub fn path(&self) -> PathBuf {
156 self.0
157 }
158
159 pub fn file_name(&self) -> OsString {
160 self.0
161 }
162
163 pub fn metadata(&self) -> io::Result<FileAttr> {
164 self.0
165 }
166
167 pub fn file_type(&self) -> io::Result<FileType> {
168 self.0
169 }
170}
171
172impl OpenOptions {
173 pub fn new() -> OpenOptions {
174 OpenOptions {}
175 }
176
177 pub fn read(&mut self, _read: bool) {}
178 pub fn write(&mut self, _write: bool) {}
179 pub fn append(&mut self, _append: bool) {}
180 pub fn truncate(&mut self, _truncate: bool) {}
181 pub fn create(&mut self, _create: bool) {}
182 pub fn create_new(&mut self, _create_new: bool) {}
183}
184
185impl File {
186 pub fn open(_path: &Path, _opts: &OpenOptions) -> io::Result<File> {
187 unsupported()
188 }
189
190 pub fn file_attr(&self) -> io::Result<FileAttr> {
191 self.0
192 }
193
194 pub fn fsync(&self) -> io::Result<()> {
195 self.0
196 }
197
198 pub fn datasync(&self) -> io::Result<()> {
199 self.0
200 }
201
202 pub fn lock(&self) -> io::Result<()> {
203 self.0
204 }
205
206 pub fn lock_shared(&self) -> io::Result<()> {
207 self.0
208 }
209
210 pub fn try_lock(&self) -> Result<(), TryLockError> {
211 self.0
212 }
213
214 pub fn try_lock_shared(&self) -> Result<(), TryLockError> {
215 self.0
216 }
217
218 pub fn unlock(&self) -> io::Result<()> {
219 self.0
220 }
221
222 pub fn truncate(&self, _size: u64) -> io::Result<()> {
223 self.0
224 }
225
226 pub fn read(&self, _buf: &mut [u8]) -> io::Result<usize> {
227 self.0
228 }
229
230 pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
231 self.0
232 }
233
234 pub fn is_read_vectored(&self) -> bool {
235 self.0
236 }
237
238 pub fn read_buf(&self, _cursor: BorrowedCursor<'_>) -> io::Result<()> {
239 self.0
240 }
241
242 pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
243 self.0
244 }
245
246 pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
247 self.0
248 }
249
250 pub fn is_write_vectored(&self) -> bool {
251 self.0
252 }
253
254 pub fn flush(&self) -> io::Result<()> {
255 self.0
256 }
257
258 pub fn seek(&self, _pos: SeekFrom) -> io::Result<u64> {
259 self.0
260 }
261
262 pub fn tell(&self) -> io::Result<u64> {
263 self.0
264 }
265
266 pub fn duplicate(&self) -> io::Result<File> {
267 self.0
268 }
269
270 pub fn set_permissions(&self, _perm: FilePermissions) -> io::Result<()> {
271 self.0
272 }
273
274 pub fn set_times(&self, _times: FileTimes) -> io::Result<()> {
275 self.0
276 }
277}
278
279impl DirBuilder {
280 pub fn new() -> DirBuilder {
281 DirBuilder {}
282 }
283
284 pub fn mkdir(&self, _p: &Path) -> io::Result<()> {
285 unsupported()
286 }
287}
288
289impl fmt::Debug for File {
290 fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
291 self.0
292 }
293}
294
295pub fn readdir(_p: &Path) -> io::Result<ReadDir> {
296 unsupported()
297}
298
299pub fn unlink(_p: &Path) -> io::Result<()> {
300 unsupported()
301}
302
303pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> {
304 unsupported()
305}
306
307pub fn set_perm(_p: &Path, perm: FilePermissions) -> io::Result<()> {
308 match perm.0 {}
309}
310
311pub fn rmdir(_p: &Path) -> io::Result<()> {
312 unsupported()
313}
314
315pub fn remove_dir_all(_path: &Path) -> io::Result<()> {
316 unsupported()
317}
318
319pub fn exists(_path: &Path) -> io::Result<bool> {
320 unsupported()
321}
322
323pub fn readlink(_p: &Path) -> io::Result<PathBuf> {
324 unsupported()
325}
326
327pub fn symlink(_original: &Path, _link: &Path) -> io::Result<()> {
328 unsupported()
329}
330
331pub fn link(_src: &Path, _dst: &Path) -> io::Result<()> {
332 unsupported()
333}
334
335pub fn stat(_p: &Path) -> io::Result<FileAttr> {
336 unsupported()
337}
338
339pub fn lstat(_p: &Path) -> io::Result<FileAttr> {
340 unsupported()
341}
342
343pub fn canonicalize(_p: &Path) -> io::Result<PathBuf> {
344 unsupported()
345}
346
347pub fn copy(_from: &Path, _to: &Path) -> io::Result<u64> {
348 unsupported()
349}