pub type WasiBidirectionalSharedPipePair = ArcFile<DuplexPipe>;
Expand description
Shared version of BidiPipe for situations where you need
to emulate the old behaviour of Pipe
(both send and recv on one channel).
Aliased Type§
struct WasiBidirectionalSharedPipePair { /* private fields */ }
Implementations
Trait Implementations
Source§impl<T> AsyncSeek for ArcFile<T>
impl<T> AsyncSeek for ArcFile<T>
Source§impl<T> AsyncWrite for ArcFile<T>
impl<T> AsyncWrite for ArcFile<T>
Source§fn poll_write(
self: Pin<&mut ArcFile<T>>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut ArcFile<T>>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize, Error>>
Attempt to write bytes from
buf
into the object. Read moreSource§fn poll_flush(
self: Pin<&mut ArcFile<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut ArcFile<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Attempts to flush the object, ensuring that any buffered data reach
their destination. Read more
Source§fn poll_shutdown(
self: Pin<&mut ArcFile<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Error>>
fn poll_shutdown( self: Pin<&mut ArcFile<T>>, cx: &mut Context<'_>, ) -> Poll<Result<(), Error>>
Initiates or attempts to shut down this writer, returning success when
the I/O connection has completely shut down. Read more
Source§fn poll_write_vectored(
self: Pin<&mut ArcFile<T>>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>],
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut ArcFile<T>>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>], ) -> Poll<Result<usize, Error>>
Like
poll_write
, except that it writes from a slice of buffers. Read moreSource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
Determines if this writer has an efficient
poll_write_vectored
implementation. Read moreSource§impl<T> VirtualFile for ArcFile<T>
impl<T> VirtualFile for ArcFile<T>
Source§fn last_accessed(&self) -> u64
fn last_accessed(&self) -> u64
the last time the file was accessed in nanoseconds as a UNIX timestamp
Source§fn last_modified(&self) -> u64
fn last_modified(&self) -> u64
the last time the file was modified in nanoseconds as a UNIX timestamp
Source§fn created_time(&self) -> u64
fn created_time(&self) -> u64
the time at which the file was created in nanoseconds as a UNIX timestamp
Source§fn set_times(
&mut self,
atime: Option<u64>,
mtime: Option<u64>,
) -> Result<(), FsError>
fn set_times( &mut self, atime: Option<u64>, mtime: Option<u64>, ) -> Result<(), FsError>
sets accessed and modified time
Source§fn set_len(&mut self, new_size: u64) -> Result<(), FsError>
fn set_len(&mut self, new_size: u64) -> Result<(), FsError>
Change the size of the file, if the
new_size
is greater than the current size
the extra bytes will be allocated and zeroedSource§fn is_open(&self) -> bool
fn is_open(&self) -> bool
Indicates if the file is opened or closed. This function must not block
Defaults to a status of being constantly open
Source§fn get_special_fd(&self) -> Option<u32>
fn get_special_fd(&self) -> Option<u32>
Used for “special” files such as
stdin
, stdout
and stderr
.
Always returns the same file descriptor (0, 1 or 2). Returns None
on normal filesSource§fn poll_read_ready(
self: Pin<&mut ArcFile<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<usize, Error>>
fn poll_read_ready( self: Pin<&mut ArcFile<T>>, cx: &mut Context<'_>, ) -> Poll<Result<usize, Error>>
Polls the file for when there is data to be read
Source§fn poll_write_ready(
self: Pin<&mut ArcFile<T>>,
cx: &mut Context<'_>,
) -> Poll<Result<usize, Error>>
fn poll_write_ready( self: Pin<&mut ArcFile<T>>, cx: &mut Context<'_>, ) -> Poll<Result<usize, Error>>
Polls the file for when it is available for writing
Source§fn write_from_mmap(&mut self, _offset: u64, _len: u64) -> Result<(), Error>
fn write_from_mmap(&mut self, _offset: u64, _len: u64) -> Result<(), Error>
Writes to this file using an mmap offset and reference
(this method only works for mmap optimized file systems)
Source§fn copy_reference(
&mut self,
src: Box<dyn VirtualFile + Send + Sync>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn copy_reference( &mut self, src: Box<dyn VirtualFile + Send + Sync>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
This method will copy a file from a source to this destination where
the default is to do a straight byte copy however file system implementors
may optimize this to do a zero copy
Source§fn copy_from_owned_buffer(
&mut self,
src: &OwnedBuffer,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn copy_from_owned_buffer( &mut self, src: &OwnedBuffer, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
This method will copy a file from a source to this destination where
the default is to do a straight byte copy however file system implementors
may optimize this to cheaply clone and store the OwnedBuffer directly