#[allow(unused_imports)]
use anyhow::Context;
#[cfg(feature = "wasi_ext")]
#[cfg(target_os = "wasi")]
pub trait FileExtContext: std :: os :: wasi :: fs :: FileExt {
fn write_all_at_wc ( & self , buf : & [ u8 ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: write_all_at(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "write_all_at", buf, offset))
}
fn read_vectored_at_wc ( & self , bufs : & mut [ std :: io :: IoSliceMut < '_ > ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < usize > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: read_vectored_at(self, bufs, offset)
.with_context(|| crate::call_failed!(Some(self), "read_vectored_at", bufs, offset))
}
fn read_at_wc ( & self , buf : & mut [ u8 ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < usize > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: read_at(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "read_at", buf, offset))
}
fn read_buf_at_wc ( & self , buf : core :: io :: BorrowedCursor < '_ > , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: read_buf_at(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "read_buf_at", crate::CustomDebugMessage("value of type BorrowedCursor"), offset))
}
fn read_exact_at_wc ( & self , buf : & mut [ u8 ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: read_exact_at(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "read_exact_at", buf, offset))
}
fn write_vectored_at_wc ( & self , bufs : & [ std :: io :: IoSlice < '_ > ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < usize > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: write_vectored_at(self, bufs, offset)
.with_context(|| crate::call_failed!(Some(self), "write_vectored_at", bufs, offset))
}
fn write_at_wc ( & self , buf : & [ u8 ] , offset : u64 ) -> crate :: rewrite_output_type ! ( std :: io :: Result < usize > ) {
< Self as :: std :: os :: wasi :: fs :: FileExt > :: write_at(self, buf, offset)
.with_context(|| crate::call_failed!(Some(self), "write_at", buf, offset))
}
}
#[cfg(feature = "wasi_ext")]
#[cfg(target_os = "wasi")]
impl<T> FileExtContext for T where T: std :: os :: wasi :: fs :: FileExt {}
#[cfg(feature = "wasi_ext")]
#[cfg(target_os = "wasi")]
pub fn symlink_path_wc < P : core :: convert :: AsRef < std :: path :: Path > , U : core :: convert :: AsRef < std :: path :: Path > > ( old_path : P , new_path : U ) -> crate :: rewrite_output_type ! ( std :: io :: Result < ( ) > ) {
let old_path = old_path.as_ref();
let new_path = new_path.as_ref();
std :: os :: wasi :: fs :: symlink_path(old_path, new_path)
.with_context(|| crate::call_failed!(None::<()>, "std::os::wasi::fs::symlink_path", old_path, new_path))
}