37
37
/// absolute paths don't interoperate well with the capability model.
38
38
///
39
39
/// [functions in `async_std::fs`]: https://docs.rs/async-std/latest/async_std/fs/index.html#functions
40
- /// [`async_std::fs::File`]: https://docs.rs/async-std/latest/async_std/fs/struct.File.html
41
40
pub struct Dir {
42
41
std_file : fs:: File ,
43
42
}
@@ -67,8 +66,6 @@ impl Dir {
67
66
///
68
67
/// This corresponds to [`async_std::fs::File::open`], but only accesses paths
69
68
/// relative to `self`.
70
- ///
71
- /// [`async_std::fs::File::open`]: https://docs.rs/async-std/latest/async_std/fs/struct.File.html#method.open
72
69
#[ inline]
73
70
pub fn open < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < File > {
74
71
self . open_with ( path, OpenOptions :: new ( ) . read ( true ) )
@@ -80,8 +77,6 @@ impl Dir {
80
77
///
81
78
/// Instead of being a method on `OpenOptions`, this is a method on `Dir`,
82
79
/// and it only accesses paths relative to `self`.
83
- ///
84
- /// [`async_std::fs::OpenOptions::open`]: https://docs.rs/async-std/latest/async_std/fs/struct.OpenOptions.html#method.open
85
80
#[ inline]
86
81
pub fn open_with < P : AsRef < Path > > ( & self , path : P , options : & OpenOptions ) -> io:: Result < File > {
87
82
let file = self . std_file . as_file_view ( ) ;
@@ -112,8 +107,6 @@ impl Dir {
112
107
///
113
108
/// This corresponds to [`async_std::fs::create_dir`], but only accesses paths
114
109
/// relative to `self`.
115
- ///
116
- /// [`async_std::fs::create_dir`]: https://docs.rs/async-std/latest/async_std/fs/fn.create_dir.html
117
110
#[ inline]
118
111
pub fn create_dir < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < ( ) > {
119
112
self . _create_dir_one ( path. as_ref ( ) , & DirOptions :: new ( ) )
@@ -123,8 +116,6 @@ impl Dir {
123
116
///
124
117
/// This corresponds to [`async_std::fs::create_dir_all`], but only accesses paths
125
118
/// relative to `self`.
126
- ///
127
- /// [`async_std::fs::create_dir_all`]: https://docs.rs/async-std/latest/async_std/fs/fn.create_dir_all.html
128
119
#[ inline]
129
120
pub fn create_dir_all < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < ( ) > {
130
121
self . _create_dir_all ( path. as_ref ( ) , & DirOptions :: new ( ) )
@@ -133,8 +124,6 @@ impl Dir {
133
124
/// Creates the specified directory with the options configured in this builder.
134
125
///
135
126
/// This corresponds to [`async_std::fs::DirBuilder::create`].
136
- ///
137
- /// [`async_std::fs::DirBuilder::create`]: https://docs.rs/async-std/latest/async_std/fs/struct.DirBuilder.html#method.create
138
127
#[ inline]
139
128
pub fn create_dir_with < P : AsRef < Path > > (
140
129
& self ,
@@ -185,8 +174,6 @@ impl Dir {
185
174
///
186
175
/// This corresponds to [`async_std::fs::File::create`], but only accesses paths
187
176
/// relative to `self`.
188
- ///
189
- /// [`async_std::fs::File::create`]: https://docs.rs/async-std/latest/async_std/fs/struct.File.html#method.create
190
177
#[ inline]
191
178
pub fn create < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < File > {
192
179
self . open_with (
@@ -200,8 +187,6 @@ impl Dir {
200
187
///
201
188
/// This corresponds to [`async_std::fs::canonicalize`], but instead of returning an
202
189
/// absolute path, returns a path relative to the directory represented by `self`.
203
- ///
204
- /// [`async_std::fs::canonicalize`]: https://docs.rs/async-std/latest/async_std/fs/fn.canonicalize.html
205
190
#[ inline]
206
191
pub fn canonicalize < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < PathBuf > {
207
192
let file = self . std_file . as_file_view ( ) ;
@@ -213,8 +198,6 @@ impl Dir {
213
198
///
214
199
/// This corresponds to [`async_std::fs::copy`], but only accesses paths
215
200
/// relative to `self`.
216
- ///
217
- /// [`async_std::fs::copy`]: https://docs.rs/async-std/latest/async_std/fs/fn.copy.html
218
201
#[ inline]
219
202
pub async fn copy < P : AsRef < Path > , Q : AsRef < Path > > (
220
203
& self ,
@@ -236,8 +219,6 @@ impl Dir {
236
219
///
237
220
/// This corresponds to [`async_std::fs::hard_link`], but only accesses paths
238
221
/// relative to `self`.
239
- ///
240
- /// [`async_std::fs::hard_link`]: https://docs.rs/async-std/latest/async_std/fs/fn.hard_link.html
241
222
#[ inline]
242
223
pub fn hard_link < P : AsRef < Path > , Q : AsRef < Path > > (
243
224
& self ,
@@ -259,8 +240,6 @@ impl Dir {
259
240
///
260
241
/// This corresponds to [`async_std::fs::metadata`], but only accesses paths
261
242
/// relative to `self`.
262
- ///
263
- /// [`async_std::fs::metadata`]: https://docs.rs/async-std/latest/async_std/fs/fn.metadata.html
264
243
#[ inline]
265
244
pub fn metadata < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < Metadata > {
266
245
let file = self . std_file . as_file_view ( ) ;
@@ -278,8 +257,6 @@ impl Dir {
278
257
///
279
258
/// This corresponds to [`async_std::fs::read_dir`], but only accesses paths
280
259
/// relative to `self`.
281
- ///
282
- /// [`async_std::fs::read_dir`]: https://docs.rs/async-std/latest/async_std/fs/fn.read_dir.html
283
260
#[ inline]
284
261
pub fn read_dir < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < ReadDir > {
285
262
let file = self . std_file . as_file_view ( ) ;
@@ -290,8 +267,6 @@ impl Dir {
290
267
///
291
268
/// This corresponds to [`async_std::fs::read`], but only accesses paths
292
269
/// relative to `self`.
293
- ///
294
- /// [`async_std::fs::read`]: https://docs.rs/async-std/latest/async_std/fs/fn.read.html
295
270
#[ inline]
296
271
pub async fn read < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < Vec < u8 > > {
297
272
use async_std:: prelude:: * ;
@@ -305,8 +280,6 @@ impl Dir {
305
280
///
306
281
/// This corresponds to [`async_std::fs::read_link`], but only accesses paths
307
282
/// relative to `self`.
308
- ///
309
- /// [`async_std::fs::read_link`]: https://docs.rs/async-std/latest/async_std/fs/fn.read_link.html
310
283
#[ inline]
311
284
pub fn read_link < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < PathBuf > {
312
285
let file = self . std_file . as_file_view ( ) ;
@@ -317,8 +290,6 @@ impl Dir {
317
290
///
318
291
/// This corresponds to [`async_std::fs::read_to_string`], but only accesses paths
319
292
/// relative to `self`.
320
- ///
321
- /// [`async_std::fs::read_to_string`]: https://docs.rs/async-std/latest/async_std/fs/fn.read_to_string.html
322
293
#[ inline]
323
294
pub async fn read_to_string < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < String > {
324
295
use async_std:: prelude:: * ;
@@ -331,8 +302,6 @@ impl Dir {
331
302
///
332
303
/// This corresponds to [`async_std::fs::remove_dir`], but only accesses paths
333
304
/// relative to `self`.
334
- ///
335
- /// [`async_std::fs::remove_dir`]: https://docs.rs/async-std/latest/async_std/fs/fn.remove_dir.html
336
305
#[ inline]
337
306
pub fn remove_dir < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < ( ) > {
338
307
let file = self . std_file . as_file_view ( ) ;
@@ -343,8 +312,6 @@ impl Dir {
343
312
///
344
313
/// This corresponds to [`async_std::fs::remove_dir_all`], but only accesses paths
345
314
/// relative to `self`.
346
- ///
347
- /// [`async_std::fs::remove_dir_all`]: https://docs.rs/async-std/latest/async_std/fs/fn.remove_dir_all.html
348
315
#[ inline]
349
316
pub async fn remove_dir_all < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < ( ) > {
350
317
let file = self . std_file . as_file_view ( ) ;
@@ -376,8 +343,6 @@ impl Dir {
376
343
///
377
344
/// This corresponds to [`async_std::fs::remove_file`], but only accesses paths
378
345
/// relative to `self`.
379
- ///
380
- /// [`async_std::fs::remove_file`]: https://docs.rs/async-std/latest/async_std/fs/fn.remove_file.html
381
346
#[ inline]
382
347
pub fn remove_file < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < ( ) > {
383
348
let file = self . std_file . as_file_view ( ) ;
@@ -388,8 +353,6 @@ impl Dir {
388
353
///
389
354
/// This corresponds to [`async_std::fs::rename`], but only accesses paths
390
355
/// relative to `self`.
391
- ///
392
- /// [`async_std::fs::rename`]: https://docs.rs/async-std/latest/async_std/fs/fn.rename.html
393
356
#[ inline]
394
357
pub fn rename < P : AsRef < Path > , Q : AsRef < Path > > (
395
358
& self ,
@@ -412,8 +375,6 @@ impl Dir {
412
375
/// This corresponds to [`async_std::fs::set_permissions`], but only accesses paths
413
376
/// relative to `self`. Also, on some platforms, this function may fail if the
414
377
/// file or directory cannot be opened for reading or writing first.
415
- ///
416
- /// [`async_std::fs::set_permissions`]: https://docs.rs/async-std/latest/async_std/fs/fn.set_permissions.html
417
378
pub fn set_permissions < P : AsRef < Path > > ( & self , path : P , perm : Permissions ) -> io:: Result < ( ) > {
418
379
let file = self . std_file . as_file_view ( ) ;
419
380
set_permissions ( & file, path. as_ref ( ) . as_ref ( ) , perm)
@@ -423,8 +384,6 @@ impl Dir {
423
384
///
424
385
/// This corresponds to [`async_std::fs::symlink_metadata`], but only accesses paths
425
386
/// relative to `self`.
426
- ///
427
- /// [`async_std::fs::symlink_metadata`]: https://docs.rs/async-std/latest/async_std/fs/fn.symlink_metadata.html
428
387
#[ inline]
429
388
pub fn symlink_metadata < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < Metadata > {
430
389
let file = self . std_file . as_file_view ( ) ;
@@ -435,8 +394,6 @@ impl Dir {
435
394
///
436
395
/// This corresponds to [`async_std::fs::write`], but only accesses paths
437
396
/// relative to `self`.
438
- ///
439
- /// [`async_std::fs::write`]: https://docs.rs/async-std/latest/async_std/fs/fn.write.html
440
397
#[ inline]
441
398
pub async fn write < P : AsRef < Path > , C : AsRef < [ u8 ] > > (
442
399
& self ,
@@ -593,8 +550,6 @@ impl Dir {
593
550
///
594
551
/// This corresponds to [`async_std::path::Path::exists`], but only
595
552
/// accesses paths relative to `self`.
596
- ///
597
- /// [`async_std::path::Path::exists`]: https://docs.rs/async-std/latest/async_std/path/struct.Path.html#method.exists
598
553
#[ inline]
599
554
pub fn exists < P : AsRef < Path > > ( & self , path : P ) -> bool {
600
555
self . metadata ( path) . is_ok ( )
@@ -604,8 +559,6 @@ impl Dir {
604
559
///
605
560
/// This corresponds to [`async_std::path::Path::is_file`], but only
606
561
/// accesses paths relative to `self`.
607
- ///
608
- /// [`async_std::path::Path::is_file`]: https://docs.rs/async-std/latest/async_std/path/struct.Path.html#method.is_file
609
562
#[ inline]
610
563
pub fn is_file < P : AsRef < Path > > ( & self , path : P ) -> bool {
611
564
self . metadata ( path) . map ( |m| m. is_file ( ) ) . unwrap_or ( false )
@@ -616,8 +569,6 @@ impl Dir {
616
569
/// This is similar to [`async_std::path::Path::is_dir`] in that it checks if `path` relative to
617
570
/// `Dir` is a directory. This function will traverse symbolic links to query information about
618
571
/// the destination file. In case of broken symbolic links, this will return `false`.
619
- ///
620
- /// [`async_std::path::Path::is_dir`]: https://docs.rs/async-std/latest/async_std/path/struct.Path.html#method.is_dir
621
572
#[ inline]
622
573
pub fn is_dir < P : AsRef < Path > > ( & self , path : P ) -> bool {
623
574
self . metadata ( path) . map ( |m| m. is_dir ( ) ) . unwrap_or ( false )
0 commit comments