File tree Expand file tree Collapse file tree 27 files changed +50
-26
lines changed Expand file tree Collapse file tree 27 files changed +50
-26
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" ) ]
You can’t perform that action at this time.
0 commit comments