@@ -1507,9 +1507,20 @@ impl windows::OpenOptionsExt for OpenOptions {
1507
1507
}
1508
1508
}
1509
1509
1510
+ mod __private {
1511
+ #[ doc( hidden) ]
1512
+ pub trait Sealed { }
1513
+
1514
+ impl Sealed for super :: OpenOptions { }
1515
+ impl Sealed for super :: File { }
1516
+ impl Sealed for super :: DirBuilder { }
1517
+ impl Sealed for super :: DirEntry { }
1518
+ }
1519
+
1510
1520
/// Unix-specific extensions.
1511
1521
#[ cfg( unix) ]
1512
1522
pub mod unix {
1523
+ use super :: __private:: Sealed ;
1513
1524
use super :: * ;
1514
1525
1515
1526
#[ doc( no_inline) ]
@@ -1533,7 +1544,7 @@ pub mod unix {
1533
1544
}
1534
1545
1535
1546
/// Unix-specific extensions to [`DirBuilder`].
1536
- pub trait DirBuilderExt {
1547
+ pub trait DirBuilderExt : Sealed {
1537
1548
/// Sets the mode to create new directories with.
1538
1549
///
1539
1550
/// This option defaults to `0o777`.
@@ -1550,7 +1561,7 @@ pub mod unix {
1550
1561
}
1551
1562
1552
1563
/// Unix-specific extension methods for [`DirEntry`].
1553
- pub trait DirEntryExt {
1564
+ pub trait DirEntryExt : Sealed {
1554
1565
/// Returns the underlying `d_ino` field in the contained `dirent` structure.
1555
1566
///
1556
1567
/// # Examples
@@ -1571,7 +1582,7 @@ pub mod unix {
1571
1582
}
1572
1583
1573
1584
/// Unix-specific extensions to [`OpenOptions`].
1574
- pub trait OpenOptionsExt {
1585
+ pub trait OpenOptionsExt : Sealed {
1575
1586
/// Sets the mode bits that a new file will be created with.
1576
1587
///
1577
1588
/// If a new file is created as part of an [`OpenOptions::open()`] call then this
@@ -1622,6 +1633,7 @@ pub mod unix {
1622
1633
/// Windows-specific extensions.
1623
1634
#[ cfg( windows) ]
1624
1635
pub mod windows {
1636
+ use super :: __private:: Sealed ;
1625
1637
use super :: * ;
1626
1638
1627
1639
#[ doc( no_inline) ]
@@ -1662,7 +1674,7 @@ pub mod windows {
1662
1674
}
1663
1675
1664
1676
/// Windows-specific extensions to [`OpenOptions`].
1665
- pub trait OpenOptionsExt {
1677
+ pub trait OpenOptionsExt : Sealed {
1666
1678
/// Overrides the `dwDesiredAccess` argument to the call to [`CreateFile`]
1667
1679
/// with the specified value.
1668
1680
///
0 commit comments