Type Alias virtual_fs::pipe::WasiBidirectionalSharedPipePair
source · 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§
Trait Implementations§
source§impl<T> AsyncWrite for ArcFile<T>where
T: VirtualFile + Send + Sync + 'static,
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>>
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 moresource§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
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<()>>
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>>
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 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>where
T: VirtualFile + Send + Sync + 'static,
impl<T> VirtualFile for ArcFile<T>where T: VirtualFile + Send + Sync + 'static,
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<()>
fn set_times(&mut self, atime: Option<u64>, mtime: Option<u64>) -> Result<()>
sets accessed and modified time
source§fn set_len(&mut self, new_size: u64) -> Result<()>
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 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 Self>,
cx: &mut Context<'_>
) -> Poll<Result<usize>>
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>>
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<()>
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<()>>
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