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