File tree Expand file tree Collapse file tree 27 files changed +51
-27
lines changed Expand file tree Collapse file tree 27 files changed +51
-27
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ pub struct File {
111111#[ derive( Clone ) ]
112112pub struct Metadata ( fs_imp:: FileAttr ) ;
113113
114+ /// Allows extension traits within `std`.
115+ #[ unstable( feature = "sealed" , issue = "none" ) ]
116+ impl crate :: sealed:: Sealed for Metadata { }
117+
114118/// Iterator over the entries in a directory.
115119///
116120/// This iterator is returned from the [`read_dir`] function of this module and
Original file line number Diff line number Diff line change 55#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
66
77use crate :: fs:: Metadata ;
8+ use crate :: sealed:: Sealed ;
89use crate :: sys_common:: AsInner ;
910
1011/// OS-specific extensions to [`fs::Metadata`].
1112///
1213/// [`fs::Metadata`]: crate::fs::Metadata
1314#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
14- pub trait MetadataExt {
15+ pub trait MetadataExt : Sealed {
1516 /// Returns the device ID on which this file resides.
1617 ///
1718 /// # Examples
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::android::raw;
1011///
1112/// [`fs::Metadata`]: crate::fs::Metadata
1213#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13- pub trait MetadataExt {
14+ pub trait MetadataExt : Sealed {
1415 /// Gain a reference to the underlying `stat` structure which contains
1516 /// the raw information returned by the OS.
1617 ///
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::dragonfly::raw;
1011///
1112/// [`fs::Metadata`]: crate::fs::Metadata
1213#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13- pub trait MetadataExt {
14+ pub trait MetadataExt : Sealed {
1415 /// Gain a reference to the underlying `stat` structure which contains
1516 /// the raw information returned by the OS.
1617 ///
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::emscripten::raw;
1011///
1112/// [`fs::Metadata`]: crate::fs::Metadata
1213#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13- pub trait MetadataExt {
14+ pub trait MetadataExt : Sealed {
1415 /// Gain a reference to the underlying `stat` structure which contains
1516 /// the raw information returned by the OS.
1617 ///
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::espidf::raw;
1011///
1112/// [`fs::Metadata`]: crate::fs::Metadata
1213#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13- pub trait MetadataExt {
14+ pub trait MetadataExt : Sealed {
1415 #[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
1516 #[ deprecated(
1617 since = "1.8.0" ,
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::freebsd::raw;
1011///
1112/// [`fs::Metadata`]: crate::fs::Metadata
1213#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13- pub trait MetadataExt {
14+ pub trait MetadataExt : Sealed {
1415 /// Gain a reference to the underlying `stat` structure which contains
1516 /// the raw information returned by the OS.
1617 ///
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67/// OS-specific extensions to [`fs::Metadata`].
78///
89/// [`fs::Metadata`]: crate::fs::Metadata
910#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
10- pub trait MetadataExt {
11+ pub trait MetadataExt : Sealed {
1112 #[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
1213 fn st_dev ( & self ) -> u64 ;
1314 #[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67#[ allow( deprecated) ]
@@ -10,7 +11,7 @@ use crate::os::haiku::raw;
1011///
1112/// [`fs::Metadata`]: crate::fs::Metadata
1213#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
13- pub trait MetadataExt {
14+ pub trait MetadataExt : Sealed {
1415 /// Gain a reference to the underlying `stat` structure which contains
1516 /// the raw information returned by the OS.
1617 ///
Original file line number Diff line number Diff line change 11#![ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
22
33use crate :: fs:: Metadata ;
4+ use crate :: sealed:: Sealed ;
45use crate :: sys_common:: AsInner ;
56
67/// OS-specific extensions to [`fs::Metadata`].
78///
89/// [`fs::Metadata`]: crate::fs::Metadata
910#[ stable( feature = "metadata_ext" , since = "1.1.0" ) ]
10- pub trait MetadataExt {
11+ pub trait MetadataExt : Sealed {
1112 #[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
1213 fn st_dev ( & self ) -> u64 ;
1314 #[ stable( feature = "metadata_ext2" , since = "1.8.0" ) ]
You can’t perform that action at this time.
0 commit comments