use sys_common::{AsInnerMut, AsInner};
/// Windows-specific extensions to `OpenOptions`
-#[unstable(feature = "open_options_ext",
- reason = "may require more thought/methods",
- issue = "27720")]
+#[stable(feature = "open_options_ext", since = "1.10.0")]
pub trait OpenOptionsExt {
/// Overrides the `dwDesiredAccess` argument to the call to `CreateFile`
/// with the specified value.
/// # Examples
///
/// ```no_run
- /// #![feature(open_options_ext)]
/// use std::fs::OpenOptions;
/// use std::os::windows::fs::OpenOptionsExt;
///
/// // to call `stat()` on the file
/// let file = OpenOptions::new().access_mode(0).open("foo.txt");
/// ```
+ #[stable(feature = "open_options_ext", since = "1.10.0")]
fn access_mode(&mut self, access: u32) -> &mut Self;
/// Overrides the `dwShareMode` argument to the call to `CreateFile` with
/// # Examples
///
/// ```no_run
- /// #![feature(open_options_ext)]
/// use std::fs::OpenOptions;
/// use std::os::windows::fs::OpenOptionsExt;
///
/// .share_mode(0)
/// .open("foo.txt");
/// ```
+ #[stable(feature = "open_options_ext", since = "1.10.0")]
fn share_mode(&mut self, val: u32) -> &mut Self;
/// Sets extra flags for the `dwFileFlags` argument to the call to
/// }
/// let file = options.open("foo.txt");
/// ```
- #[unstable(feature = "expand_open_options",
- reason = "recently added",
- issue = "30014")]
+ #[stable(feature = "open_options_ext", since = "1.10.0")]
fn custom_flags(&mut self, flags: u32) -> &mut Self;
/// Sets the `dwFileAttributes` argument to the call to `CreateFile2` to
/// # Examples
///
/// ```rust,ignore
- /// #![feature(open_options_ext)]
/// extern crate winapi;
/// use std::fs::OpenOptions;
/// use std::os::windows::fs::OpenOptionsExt;
/// .attributes(winapi::FILE_ATTRIBUTE_HIDDEN)
/// .open("foo.txt");
/// ```
+ #[stable(feature = "open_options_ext", since = "1.10.0")]
fn attributes(&mut self, val: u32) -> &mut Self;
/// Sets the `dwSecurityQosFlags` argument to the call to `CreateFile2` to
/// the specified value (or combines it with `custom_flags` and `attributes`
/// to set the `dwFlagsAndAttributes` for `CreateFile`).
+ #[stable(feature = "open_options_ext", since = "1.10.0")]
fn security_qos_flags(&mut self, flags: u32) -> &mut OpenOptions;
}
-#[unstable(feature = "open_options_ext",
- reason = "may require more thought/methods",
- issue = "27720")]
+#[stable(feature = "open_options_ext", since = "1.10.0")]
impl OpenOptionsExt for OpenOptions {
fn access_mode(&mut self, access: u32) -> &mut OpenOptions {
self.as_inner_mut().access_mode(access); self