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 {
    inner: Arc<Mutex<Box<DuplexPipe, Global>>, Global>,
}

Fields§

§inner: Arc<Mutex<Box<DuplexPipe, Global>>, Global>

Implementations§

source§

impl<T> ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source

pub fn new(inner: Box<T>) -> Self

Trait Implementations§

source§

impl<T> AsyncRead for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source§

fn poll_read( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut ReadBuf<'_> ) -> Poll<Result<()>>

Attempts to read from the AsyncRead into buf. Read more
source§

impl<T> AsyncSeek for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source§

fn start_seek(self: Pin<&mut Self>, position: SeekFrom) -> Result<()>

Attempts to seek to an offset, in bytes, in a stream. Read more
source§

fn poll_complete( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<u64>>

Waits for a seek operation to complete. Read more
source§

impl<T> AsyncWrite for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source§

fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8] ) -> Poll<Result<usize>>

Attempt to write bytes from buf into the object. Read more
source§

fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>

Attempts to flush the object, ensuring that any buffered data reach their destination. Read more
source§

fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>

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 Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>] ) -> Poll<Result<usize>>

Like poll_write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

Determines if this writer has an efficient poll_write_vectored implementation. Read more
source§

impl<T> Clone for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for ArcFile<T>where T: VirtualFile + Send + Sync + 'static + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T> VirtualFile for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,

source§

fn last_accessed(&self) -> u64

the last time the file was accessed in nanoseconds as a UNIX timestamp
source§

fn last_modified(&self) -> u64

the last time the file was modified in nanoseconds as a UNIX timestamp
source§

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<()>

sets accessed and modified time
source§

fn size(&self) -> u64

the size of the file in bytes
source§

fn set_len(&mut self, new_size: u64) -> Result<()>

Change the size of the file, if the new_size is greater than the current size the extra bytes will be allocated and zeroed
Request deletion of the file
source§

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>

Used for “special” files such as stdin, stdout and stderr. Always returns the same file descriptor (0, 1 or 2). Returns None on normal files
source§

fn poll_read_ready( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<usize>>

Polls the file for when there is data to be read
source§

fn poll_write_ready( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<usize>>

Polls the file for when it is available for writing
source§

fn write_from_mmap(&mut self, _offset: u64, _len: u64) -> Result<()>

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 + 'static> ) -> BoxFuture<'_, Result<()>>

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§

impl<T> ClonableVirtualFile for ArcFile<T>where T: VirtualFile + Send + Sync + 'static + Clone,