#[allow(unused_imports)]
use anyhow::Context;
#[cfg(windows)]
pub trait FileExtContext: std :: os :: windows :: fs :: FileExt {
fn seek_read_wc ( & self , buf : & mut [ u8 ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < usize > ) {
< Self as :: std :: os :: windows :: fs :: FileExt > :: seek_read(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "seek_read", buf, offset))
}
#[cfg(feature = "read_buf_at")]
fn seek_read_buf_wc ( & self , buf : core :: io :: BorrowedCursor < '_ > , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
< Self as :: std :: os :: windows :: fs :: FileExt > :: seek_read_buf(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "seek_read_buf", crate::CustomDebugMessage("value of type BorrowedCursor"), offset))
}
fn seek_write_wc ( & self , buf : & [ u8 ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < usize > ) {
< Self as :: std :: os :: windows :: fs :: FileExt > :: seek_write(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "seek_write", buf, offset))
}
}
#[cfg(windows)]
impl<T> FileExtContext for T where T: std :: os :: windows :: fs :: FileExt {}
#[cfg(windows)]
pub trait MetadataExtContext: std :: os :: windows :: fs :: MetadataExt {
#[cfg(feature = "windows_change_time")]
fn change_time_wc ( & self ) -> crate :: rewrite_output_type ! ( core :: option :: Option < u64 > ) {
< Self as :: std :: os :: windows :: fs :: MetadataExt > :: change_time(self)
.with_context(|| crate::call_failed!(Some(self), "change_time"))
}
#[cfg(feature = "windows_by_handle")]
fn volume_serial_number_wc ( & self ) -> crate :: rewrite_output_type ! ( core :: option :: Option < u32 > ) {
< Self as :: std :: os :: windows :: fs :: MetadataExt > :: volume_serial_number(self)
.with_context(|| crate::call_failed!(Some(self), "volume_serial_number"))
}
#[cfg(feature = "windows_by_handle")]
fn file_index_wc ( & self ) -> crate :: rewrite_output_type ! ( core :: option :: Option < u64 > ) {
< Self as :: std :: os :: windows :: fs :: MetadataExt > :: file_index(self)
.with_context(|| crate::call_failed!(Some(self), "file_index"))
}
#[cfg(feature = "windows_by_handle")]
fn number_of_links_wc ( & self ) -> crate :: rewrite_output_type ! ( core :: option :: Option < u32 > ) {
< Self as :: std :: os :: windows :: fs :: MetadataExt > :: number_of_links(self)
.with_context(|| crate::call_failed!(Some(self), "number_of_links"))
}
}
#[cfg(windows)]
impl<T> MetadataExtContext for T where T: std :: os :: windows :: fs :: MetadataExt {}
#[cfg(feature = "junction_point")]
#[cfg(windows)]
pub fn junction_point_wc < P : core :: convert :: AsRef < std :: path :: Path > , Q : core :: convert :: AsRef < std :: path :: Path > > ( original : P , link : Q ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
let original = original.as_ref();
let link = link.as_ref();
std :: os :: windows :: fs :: junction_point(original, link)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::fs::junction_point", original, link))
}
#[cfg(windows)]
pub fn symlink_dir_wc < P : core :: convert :: AsRef < std :: path :: Path > , Q : core :: convert :: AsRef < std :: path :: Path > > ( original : P , link : Q ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
let original = original.as_ref();
let link = link.as_ref();
std :: os :: windows :: fs :: symlink_dir(original, link)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::fs::symlink_dir", original, link))
}
#[cfg(windows)]
pub fn symlink_file_wc < P : core :: convert :: AsRef < std :: path :: Path > , Q : core :: convert :: AsRef < std :: path :: Path > > ( original : P , link : Q ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
let original = original.as_ref();
let link = link.as_ref();
std :: os :: windows :: fs :: symlink_file(original, link)
.with_context(|| crate::call_failed!(None::<()>, "std::os::windows::fs::symlink_file", original, link))
}