File tree 27 files changed +51
-27
lines changed
27 files changed +51
-27
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ pub struct File {
111
111
#[ derive( Clone ) ]
112
112
pub struct Metadata ( fs_imp:: FileAttr ) ;
113
113
114
+ /// Allows extension traits within `std`.
115
+ #[ unstable( feature = "sealed" , issue = "none" ) ]
116
+ impl crate :: sealed:: Sealed for Metadata { }
117
+
114
118
/// Iterator over the entries in a directory.
115
119
///
116
120
/// This iterator is returned from the [`read_dir`] function of this module and
Original file line number Diff line number Diff line change 5
5
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
6
6
7
7
use crate :: fs:: Metadata ;
8
+ use crate :: sealed:: Sealed ;
8
9
use crate :: sys_common:: AsInner ;
9
10
10
11
/// OS-specific extensions to [`fs::Metadata`].
11
12
///
12
13
/// [`fs::Metadata`]: crate::fs::Metadata
13
14
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
14
- pub trait MetadataExt {
15
+ pub trait MetadataExt : Sealed {
15
16
/// Returns the device ID on which this file resides.
16
17
///
17
18
/// # Examples
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::android::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::dragonfly::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::emscripten::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::espidf::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
15
16
#[ deprecated(
16
17
since = "1.8.0" ,
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::freebsd::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
/// OS-specific extensions to [`fs::Metadata`].
7
8
///
8
9
/// [`fs::Metadata`]: crate::fs::Metadata
9
10
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
10
- pub trait MetadataExt {
11
+ pub trait MetadataExt : Sealed {
11
12
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
12
13
fn st_dev ( & self ) -> u64 ;
13
14
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::haiku::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
/// OS-specific extensions to [`fs::Metadata`].
7
8
///
8
9
/// [`fs::Metadata`]: crate::fs::Metadata
9
10
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
10
- pub trait MetadataExt {
11
+ pub trait MetadataExt : Sealed {
11
12
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
12
13
fn st_dev ( & self ) -> u64 ;
13
14
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
Original file line number Diff line number Diff line change 5
5
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
6
6
7
7
use crate :: fs:: Metadata ;
8
+ use crate :: sealed:: Sealed ;
8
9
use crate :: sys_common:: AsInner ;
9
10
10
11
/// OS-specific extensions to [`fs::Metadata`].
11
12
///
12
13
/// [`fs::Metadata`]: crate::fs::Metadata
13
14
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
14
- pub trait MetadataExt {
15
+ pub trait MetadataExt : Sealed {
15
16
/// Returns the device ID on which this file resides.
16
17
///
17
18
/// # Examples
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::illumos::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use super::raw;
12
12
///
13
13
/// [`fs::Metadata`]: crate::fs::Metadata
14
14
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
15
- pub trait MetadataExt {
15
+ pub trait MetadataExt : Sealed {
16
16
/// Gain a reference to the underlying `stat` structure which contains
17
17
/// the raw information returned by the OS.
18
18
///
Original file line number Diff line number Diff line change 5
5
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
6
6
7
7
use crate :: fs:: Metadata ;
8
+ use crate :: sealed:: Sealed ;
8
9
use crate :: sys_common:: AsInner ;
9
10
10
11
#[ allow( deprecated) ]
@@ -14,7 +15,7 @@ use crate::os::l4re::raw;
14
15
///
15
16
/// [`fs::Metadata`]: crate::fs::Metadata
16
17
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
17
- pub trait MetadataExt {
18
+ pub trait MetadataExt : Sealed {
18
19
/// Gain a reference to the underlying `stat` structure which contains
19
20
/// the raw information returned by the OS.
20
21
///
Original file line number Diff line number Diff line change 5
5
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
6
6
7
7
use crate :: fs:: Metadata ;
8
+ use crate :: sealed:: Sealed ;
8
9
use crate :: sys_common:: AsInner ;
9
10
10
11
#[ allow( deprecated) ]
@@ -14,7 +15,7 @@ use crate::os::linux::raw;
14
15
///
15
16
/// [`fs::Metadata`]: crate::fs::Metadata
16
17
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
17
- pub trait MetadataExt {
18
+ pub trait MetadataExt : Sealed {
18
19
/// Gain a reference to the underlying `stat` structure which contains
19
20
/// the raw information returned by the OS.
20
21
///
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::os::macos::raw;
12
12
///
13
13
/// [`fs::Metadata`]: crate::fs::Metadata
14
14
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
15
- pub trait MetadataExt {
15
+ pub trait MetadataExt : Sealed {
16
16
/// Gain a reference to the underlying `stat` structure which contains
17
17
/// the raw information returned by the OS.
18
18
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::netbsd::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
7
- pub trait MetadataExt {
8
+ pub trait MetadataExt : Sealed {
8
9
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
9
10
fn st_dev ( & self ) -> u64 ;
10
11
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::openbsd::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::redox::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::solaris::raw;
10
11
///
11
12
/// [`fs::Metadata`]: crate::fs::Metadata
12
13
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13
- pub trait MetadataExt {
14
+ pub trait MetadataExt : Sealed {
14
15
/// Gain a reference to the underlying `stat` structure which contains
15
16
/// the raw information returned by the OS.
16
17
///
Original file line number Diff line number Diff line change @@ -429,7 +429,7 @@ impl OpenOptionsExt for OpenOptions {
429
429
430
430
/// Unix-specific extensions to [`fs::Metadata`].
431
431
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
432
- pub trait MetadataExt {
432
+ pub trait MetadataExt : Sealed {
433
433
/// Returns the ID of the device containing the file.
434
434
///
435
435
/// # Examples
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
6
6
7
/// OS-specific extensions to [`fs::Metadata`].
7
8
///
8
9
/// [`fs::Metadata`]: crate::fs::Metadata
9
10
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
10
- pub trait MetadataExt {
11
+ pub trait MetadataExt : Sealed {
11
12
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
12
13
fn st_dev ( & self ) -> u64 ;
13
14
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
Original file line number Diff line number Diff line change 1
1
#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
2
2
3
3
use crate :: fs:: Metadata ;
4
+ use crate :: sealed:: Sealed ;
4
5
use crate :: sys_common:: AsInner ;
5
-
6
6
///
7
7
/// [`fs::Metadata`]: crate::fs::Metadata
8
8
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
9
- pub trait MetadataExt {
9
+ pub trait MetadataExt : Sealed {
10
10
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
11
11
fn st_dev ( & self ) -> u64 ;
12
12
#[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ use crate::ffi::OsStr;
9
9
use crate :: fs:: { self , File , Metadata , OpenOptions } ;
10
10
use crate :: io:: { self , IoSlice , IoSliceMut } ;
11
11
use crate :: path:: { Path , PathBuf } ;
12
+ use crate :: sealed:: Sealed ;
12
13
use crate :: sys_common:: { AsInner , AsInnerMut , FromInner } ;
13
14
// Used for `File::read` on intra-doc links
14
15
#[ allow( unused_imports) ]
@@ -410,7 +411,7 @@ impl OpenOptionsExt for OpenOptions {
410
411
}
411
412
412
413
/// WASI-specific extensions to [`fs::Metadata`].
413
- pub trait MetadataExt {
414
+ pub trait MetadataExt : Sealed {
414
415
/// Returns the `st_dev` field of the internal `filestat_t`
415
416
fn dev ( & self ) -> u64 ;
416
417
/// Returns the `st_ino` field of the internal `filestat_t`
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::os::watchos::raw;
12
12
///
13
13
/// [`fs::Metadata`]: crate::fs::Metadata
14
14
#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
15
- pub trait MetadataExt {
15
+ pub trait MetadataExt : Sealed {
16
16
/// Gain a reference to the underlying `stat` structure which contains
17
17
/// the raw information returned by the OS.
18
18
///
You can’t perform that action at this time.
0 commit comments