Skip to content

Commit

Permalink
Seal MetadataExt
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Dec 13, 2023
1 parent c3def26 commit c59705f
Show file tree
Hide file tree
Showing 26 changed files with 96 additions and 26 deletions.
5 changes: 4 additions & 1 deletion library/std/src/os/aix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

/// OS-specific extensions to [`fs::Metadata`].
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Returns the device ID on which this file resides.
///
/// # Examples
Expand Down Expand Up @@ -294,6 +295,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/android/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::android::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -59,6 +60,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/dragonfly/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::dragonfly::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -65,6 +66,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_lspare(&self) -> u32;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/emscripten/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::emscripten::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -59,6 +60,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/espidf/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::espidf::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
#[stable(feature = "metadata_ext", since = "1.1.0")]
#[deprecated(
since = "1.8.0",
Expand Down Expand Up @@ -55,6 +56,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_spare4(&self) -> [u32; 2];
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/freebsd/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::freebsd::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -69,6 +70,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_lspare(&self) -> u32;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/fuchsia/fs.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

/// OS-specific extensions to [`fs::Metadata`].
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_dev(&self) -> u64;
#[stable(feature = "metadata_ext2", since = "1.8.0")]
Expand Down Expand Up @@ -41,6 +42,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/haiku/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::haiku::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -63,6 +64,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/horizon/fs.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

/// OS-specific extensions to [`fs::Metadata`].
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_dev(&self) -> u64;
#[stable(feature = "metadata_ext2", since = "1.8.0")]
Expand Down Expand Up @@ -41,6 +42,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/hurd/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

/// OS-specific extensions to [`fs::Metadata`].
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Returns the device ID on which this file resides.
///
/// # Examples
Expand Down Expand Up @@ -294,6 +295,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/illumos/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::illumos::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -58,6 +59,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
4 changes: 3 additions & 1 deletion library/std/src/os/ios/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -71,6 +71,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_lspare(&self) -> u32;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/l4re/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -14,7 +15,7 @@ use crate::os::l4re::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -324,6 +325,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/linux/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -14,7 +15,7 @@ use crate::os::linux::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -324,6 +325,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_blocks(&self) -> u64;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
4 changes: 3 additions & 1 deletion library/std/src/os/macos/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::os::macos::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -73,6 +73,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_qspare(&self) -> [u64; 2];
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
5 changes: 4 additions & 1 deletion library/std/src/os/netbsd/fs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![stable(feature = "metadata_ext", since = "1.1.0")]

use crate::fs::Metadata;
use crate::sealed::Sealed;
use crate::sys_common::AsInner;

#[allow(deprecated)]
Expand All @@ -10,7 +11,7 @@ use crate::os::netbsd::raw;
///
/// [`fs::Metadata`]: crate::fs::Metadata
#[stable(feature = "metadata_ext", since = "1.1.0")]
pub trait MetadataExt {
pub trait MetadataExt: Sealed {
/// Gain a reference to the underlying `stat` structure which contains
/// the raw information returned by the OS.
///
Expand Down Expand Up @@ -67,6 +68,8 @@ pub trait MetadataExt {
#[stable(feature = "metadata_ext2", since = "1.8.0")]
fn st_gen(&self) -> u32;
}
#[stable(feature = "metadata_ext", since = "1.1.0")]
impl Sealed for Metadata {}

#[stable(feature = "metadata_ext", since = "1.1.0")]
impl MetadataExt for Metadata {
Expand Down
Loading

0 comments on commit c59705f

Please sign in to comment.