#![warn(rust_2018_idioms)] #![cfg(all(feature = "full", not(target_os = "wasi")))] // WASI does not support all fs operations #![cfg(windows)]
use tokio::fs::OpenOptions; use windows_sys::Win32::Storage::FileSystem;
#[tokio::test] #[cfg(windows)] asyncfn open_options_windows_access_mode() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().access_mode(0)).contains("access_mode: Some(0)"));
}
#[tokio::test] #[cfg(windows)] asyncfn open_options_windows_share_mode() { // TESTING HACK: use Debug output to check the stored data
assert!(format!("{:?}", OpenOptions::new().share_mode(0)).contains("share_mode: 0,"));
}
#[tokio::test] #[cfg(windows)] asyncfn open_options_windows_custom_flags() { // TESTING HACK: use Debug output to check the stored data
assert!(format!( "{:?}",
OpenOptions::new().custom_flags(FileSystem::FILE_FLAG_DELETE_ON_CLOSE)
)
.contains("custom_flags: 67108864,"));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.