Currently we have a `set_mode` mutator, so this just adds the pairing of a
`mode` accessor to read the value.
Closes #22738
}
}
+impl AsInner<fs_imp::FilePermissions> for Permissions {
+ fn as_inner(&self) -> &fs_imp::FilePermissions { &self.0 }
+}
+
impl Iterator for ReadDir {
type Item = io::Result<DirEntry>;
// Unix-specific extensions to `Permissions`
pub trait PermissionsExt {
+ fn mode(&self) -> i32;
fn set_mode(&mut self, mode: i32);
}
impl PermissionsExt for Permissions {
+ fn mode(&self) -> i32 { self.as_inner().mode() }
+
fn set_mode(&mut self, mode: i32) {
*self = FromInner::from_inner(FromInner::from_inner(mode));
}
self.mode |= 0o222;
}
}
+ pub fn mode(&self) -> i32 { self.mode as i32 }
}
impl FromInner<i32> for FilePermissions {