1 use crate::ffi
::OsString
;
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}
;
11 pub struct FileAttr(Void
);
13 pub struct ReadDir(Void
);
15 pub struct DirEntry(Void
);
17 #[derive(Clone, Debug)]
18 pub struct OpenOptions {}
20 pub struct FilePermissions(Void
);
22 pub struct FileType(Void
);
25 pub struct DirBuilder {}
28 pub fn size(&self) -> u64 {
32 pub fn perm(&self) -> FilePermissions
{
36 pub fn file_type(&self) -> FileType
{
40 pub fn modified(&self) -> io
::Result
<SystemTime
> {
44 pub fn accessed(&self) -> io
::Result
<SystemTime
> {
48 pub fn created(&self) -> io
::Result
<SystemTime
> {
53 impl Clone
for FileAttr
{
54 fn clone(&self) -> FileAttr
{
59 impl FilePermissions
{
60 pub fn readonly(&self) -> bool
{
64 pub fn set_readonly(&mut self, _readonly
: bool
) {
69 impl Clone
for FilePermissions
{
70 fn clone(&self) -> FilePermissions
{
75 impl PartialEq
for FilePermissions
{
76 fn eq(&self, _other
: &FilePermissions
) -> bool
{
81 impl Eq
for FilePermissions {}
83 impl fmt
::Debug
for FilePermissions
{
84 fn fmt(&self, _f
: &mut fmt
::Formatter
<'_
>) -> fmt
::Result
{
90 pub fn is_dir(&self) -> bool
{
94 pub fn is_file(&self) -> bool
{
98 pub fn is_symlink(&self) -> bool
{
103 impl Clone
for FileType
{
104 fn clone(&self) -> FileType
{
109 impl Copy
for FileType {}
111 impl PartialEq
for FileType
{
112 fn eq(&self, _other
: &FileType
) -> bool
{
117 impl Eq
for FileType {}
119 impl Hash
for FileType
{
120 fn hash
<H
: Hasher
>(&self, _h
: &mut H
) {
125 impl fmt
::Debug
for FileType
{
126 fn fmt(&self, _f
: &mut fmt
::Formatter
<'_
>) -> fmt
::Result
{
131 impl fmt
::Debug
for ReadDir
{
132 fn fmt(&self, _f
: &mut fmt
::Formatter
<'_
>) -> fmt
::Result
{
137 impl Iterator
for ReadDir
{
138 type Item
= io
::Result
<DirEntry
>;
140 fn next(&mut self) -> Option
<io
::Result
<DirEntry
>> {
146 pub fn path(&self) -> PathBuf
{
150 pub fn file_name(&self) -> OsString
{
154 pub fn metadata(&self) -> io
::Result
<FileAttr
> {
158 pub fn file_type(&self) -> io
::Result
<FileType
> {
164 pub fn new() -> OpenOptions
{
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
) {}
177 pub fn open(_path
: &Path
, _opts
: &OpenOptions
) -> io
::Result
<File
> {
181 pub fn file_attr(&self) -> io
::Result
<FileAttr
> {
185 pub fn fsync(&self) -> io
::Result
<()> {
189 pub fn datasync(&self) -> io
::Result
<()> {
193 pub fn truncate(&self, _size
: u64) -> io
::Result
<()> {
197 pub fn read(&self, _buf
: &mut [u8]) -> io
::Result
<usize> {
201 pub fn read_vectored(&self, _bufs
: &mut [IoSliceMut
<'_
>]) -> io
::Result
<usize> {
205 pub fn is_read_vectored(&self) -> bool
{
209 pub fn write(&self, _buf
: &[u8]) -> io
::Result
<usize> {
213 pub fn write_vectored(&self, _bufs
: &[IoSlice
<'_
>]) -> io
::Result
<usize> {
217 pub fn is_write_vectored(&self) -> bool
{
221 pub fn flush(&self) -> io
::Result
<()> {
225 pub fn seek(&self, _pos
: SeekFrom
) -> io
::Result
<u64> {
229 pub fn duplicate(&self) -> io
::Result
<File
> {
233 pub fn set_permissions(&self, _perm
: FilePermissions
) -> io
::Result
<()> {
237 pub fn diverge(&self) -> ! {
243 pub fn new() -> DirBuilder
{
247 pub fn mkdir(&self, _p
: &Path
) -> io
::Result
<()> {
252 impl fmt
::Debug
for File
{
253 fn fmt(&self, _f
: &mut fmt
::Formatter
<'_
>) -> fmt
::Result
{
258 pub fn readdir(_p
: &Path
) -> io
::Result
<ReadDir
> {
262 pub fn unlink(_p
: &Path
) -> io
::Result
<()> {
266 pub fn rename(_old
: &Path
, _new
: &Path
) -> io
::Result
<()> {
270 pub fn set_perm(_p
: &Path
, perm
: FilePermissions
) -> io
::Result
<()> {
274 pub fn rmdir(_p
: &Path
) -> io
::Result
<()> {
278 pub fn remove_dir_all(_path
: &Path
) -> io
::Result
<()> {
282 pub fn readlink(_p
: &Path
) -> io
::Result
<PathBuf
> {
286 pub fn symlink(_src
: &Path
, _dst
: &Path
) -> io
::Result
<()> {
290 pub fn link(_src
: &Path
, _dst
: &Path
) -> io
::Result
<()> {
294 pub fn stat(_p
: &Path
) -> io
::Result
<FileAttr
> {
298 pub fn lstat(_p
: &Path
) -> io
::Result
<FileAttr
> {
302 pub fn canonicalize(_p
: &Path
) -> io
::Result
<PathBuf
> {
306 pub fn copy(_from
: &Path
, _to
: &Path
) -> io
::Result
<u64> {