wasi_common::file

Trait WasiFile

source
pub trait WasiFile: Send + Sync {
Show 25 methods // Required methods fn as_any(&self) -> &dyn Any; fn get_filetype<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FileType, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn pollable(&self) -> Option<BorrowedFd<'_>> { ... } fn isatty(&self) -> bool { ... } fn sock_accept<'life0, 'async_trait>( &'life0 self, _fdflags: FdFlags, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn WasiFile>, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn sock_recv<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _ri_data: &'life1 mut [IoSliceMut<'a>], _ri_flags: RiFlags, ) -> Pin<Box<dyn Future<Output = Result<(u64, RoFlags), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn sock_send<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _si_data: &'life1 [IoSlice<'a>], _si_flags: SiFlags, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn sock_shutdown<'life0, 'async_trait>( &'life0 self, _how: SdFlags, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn datasync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn sync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_fdflags<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FdFlags, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn set_fdflags<'life0, 'async_trait>( &'life0 mut self, _flags: FdFlags, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_filestat<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn set_filestat_size<'life0, 'async_trait>( &'life0 self, _size: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn advise<'life0, 'async_trait>( &'life0 self, _offset: u64, _len: u64, _advice: Advice, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn set_times<'life0, 'async_trait>( &'life0 self, _atime: Option<SystemTimeSpec>, _mtime: Option<SystemTimeSpec>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn read_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 mut [IoSliceMut<'a>], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn read_vectored_at<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 mut [IoSliceMut<'a>], _offset: u64, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn write_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 [IoSlice<'a>], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn write_vectored_at<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 [IoSlice<'a>], _offset: u64, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn seek<'life0, 'async_trait>( &'life0 self, _pos: SeekFrom, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn peek<'life0, 'life1, 'async_trait>( &'life0 self, _buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn num_ready_bytes(&self) -> Result<u64, Error> { ... } fn readable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn writable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}

Required Methods§

source

fn as_any(&self) -> &dyn Any

source

fn get_filetype<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FileType, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

source

fn pollable(&self) -> Option<BorrowedFd<'_>>

source

fn isatty(&self) -> bool

source

fn sock_accept<'life0, 'async_trait>( &'life0 self, _fdflags: FdFlags, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn WasiFile>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn sock_recv<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _ri_data: &'life1 mut [IoSliceMut<'a>], _ri_flags: RiFlags, ) -> Pin<Box<dyn Future<Output = Result<(u64, RoFlags), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn sock_send<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _si_data: &'life1 [IoSlice<'a>], _si_flags: SiFlags, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn sock_shutdown<'life0, 'async_trait>( &'life0 self, _how: SdFlags, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn datasync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn sync<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_fdflags<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FdFlags, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn set_fdflags<'life0, 'async_trait>( &'life0 mut self, _flags: FdFlags, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn get_filestat<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn set_filestat_size<'life0, 'async_trait>( &'life0 self, _size: u64, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn advise<'life0, 'async_trait>( &'life0 self, _offset: u64, _len: u64, _advice: Advice, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn set_times<'life0, 'async_trait>( &'life0 self, _atime: Option<SystemTimeSpec>, _mtime: Option<SystemTimeSpec>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn read_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 mut [IoSliceMut<'a>], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn read_vectored_at<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 mut [IoSliceMut<'a>], _offset: u64, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn write_vectored<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 [IoSlice<'a>], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn write_vectored_at<'a, 'life0, 'life1, 'async_trait>( &'life0 self, _bufs: &'life1 [IoSlice<'a>], _offset: u64, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn seek<'life0, 'async_trait>( &'life0 self, _pos: SeekFrom, ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn peek<'life0, 'life1, 'async_trait>( &'life0 self, _buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn num_ready_bytes(&self) -> Result<u64, Error>

source

fn readable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn writable<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Trait Implementations§

source§

impl From<Socket> for Box<dyn WasiFile>

Available on crate feature sync only.
source§

fn from(listener: Socket) -> Self

Converts to this type from the input type.

Implementors§

source§

impl WasiFile for File

Available on crate feature sync only.
source§

impl WasiFile for TcpListener

Available on crate feature sync only.
source§

impl WasiFile for TcpStream

Available on crate feature sync only.
source§

impl WasiFile for UnixListener

Available on crate feature sync only.
source§

impl WasiFile for UnixStream

Available on crate feature sync only.
source§

impl WasiFile for Stderr

Available on crate feature sync only.
source§

impl WasiFile for Stdin

Available on crate feature sync only.
source§

impl WasiFile for Stdout

Available on crate feature sync only.
source§

impl<R: Read + Any + Send + Sync> WasiFile for ReadPipe<R>

source§

impl<W: Write + Any + Send + Sync> WasiFile for WritePipe<W>