pub struct WasiP1Ctx {
    pub table: ResourceTable,
    pub wasi: WasiCtx,
    pub adapter: WasiPreview1Adapter,
}

Fields§

§table: ResourceTable§wasi: WasiCtx§adapter: WasiPreview1Adapter

Implementations§

source§

impl WasiP1Ctx

source

pub fn new(wasi: WasiCtx) -> Self

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> GetSetFdFlags for T

source§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
source§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
source§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn create_tcp_socket( &mut self, address_family: IpAddressFamily ) -> Result<Resource<TcpSocket>, TrappableError<ErrorCode>>

Create a new TCP socket. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn instance_network(&mut self) -> Result<Resource<Network>, Error>

Get a handle to the default network.
source§

impl<T> Host for T
where T: WasiView,

source§

fn poll( &mut self, pollables: Vec<Resource<Pollable>> ) -> Result<Vec<u32>, Error>

Poll for completion on a set of pollables. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn create_udp_socket( &mut self, address_family: IpAddressFamily ) -> Result<Resource<UdpSocket>, TrappableError<ErrorCode>>

Create a new UDP socket. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn poll<'life0, 'async_trait>( &'life0 mut self, pollables: Vec<Resource<Pollable>> ) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Poll for completion on a set of pollables. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn get_terminal_stdin( &mut self ) -> Result<Option<Resource<TerminalInput>>, Error>

If stdin is connected to a terminal, return a terminal-input handle allowing further interaction with it.
source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

fn get_terminal_stdout( &mut self ) -> Result<Option<Resource<TerminalOutput>>, Error>

If stdout is connected to a terminal, return a terminal-output handle allowing further interaction with it.
source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

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

Read the current value of the clock. Read more
source§

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

Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.
source§

fn subscribe_instant(&mut self, when: u64) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the specified instant occured.
source§

fn subscribe_duration( &mut self, duration: u64 ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the given duration has elapsed, starting at the time at which this function was called. occured.
source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

fn get_environment(&mut self) -> Result<Vec<(String, String)>, Error>

Get the POSIX-style environment variables. Read more
source§

fn get_arguments(&mut self) -> Result<Vec<String>, Error>

Get the POSIX-style arguments to the program.
source§

fn initial_cwd(&mut self) -> Result<Option<String>, Error>

Return a path that programs should use as their initial current working directory, interpreting . as shorthand for this.
source§

impl<T> Host for T
where T: WasiView,

source§

fn convert_error_code( &mut self, err: TrappableError<ErrorCode> ) -> Result<ErrorCode, Error>

source§

fn filesystem_error_code( &mut self, err: Resource<Error> ) -> Result<Option<ErrorCode>, Error>

Attempts to extract a filesystem-related error-code from the stream error provided. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

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

Return a 128-bit value that may contain a pseudo-random value. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

fn get_insecure_random_bytes(&mut self, len: u64) -> Result<Vec<u8>, Error>

Return len insecure pseudo-random bytes. Read more
source§

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

Return an insecure pseudo-random u64 value. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn get_random_bytes(&mut self, len: u64) -> Result<Vec<u8>, Error>

Return len cryptographically-secure random or pseudo-random bytes. Read more
source§

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

Return a cryptographically-secure random or pseudo-random u64 value. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

fn exit(&mut self, status: Result<(), ()>) -> Result<(), Error>

Exit the current instance and any linked instances.
source§

impl<T> Host for T
where T: WasiView,

source§

fn get_terminal_stderr( &mut self ) -> Result<Option<Resource<TerminalOutput>>, Error>

If stderr is connected to a terminal, return a terminal-output handle allowing further interaction with it.
source§

impl<T> Host for T
where T: WasiView,

source§

fn get_directories( &mut self ) -> Result<Vec<(Resource<Descriptor>, String)>, Error>

Return the set of preopened directories, and their path.
source§

impl<T> Host for T
where T: WasiView,

source§

fn now(&mut self) -> Result<Datetime, Error>

Read the current value of the clock. Read more
source§

fn resolution(&mut self) -> Result<Datetime, Error>

Query the resolution of the clock. Read more
source§

impl<T> Host for T
where T: Host,

source§

fn convert_error_code( &mut self, err: TrappableError<ErrorCode> ) -> Result<ErrorCode, Error>

source§

fn filesystem_error_code( &mut self, err: Resource<Error> ) -> Result<Option<ErrorCode>, Error>

Attempts to extract a filesystem-related error-code from the stream error provided. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

fn resolve_addresses( &mut self, network: Resource<Network>, name: String ) -> Result<Resource<ResolveAddressStream>, TrappableError<ErrorCode>>

Resolve an internet host name to a list of IP addresses. Read more
source§

impl<T> HostDescriptor for T
where T: HostDescriptor,

source§

fn advise( &mut self, fd: Resource<Descriptor>, offset: u64, len: u64, advice: Advice ) -> Result<(), TrappableError<ErrorCode>>

Provide file advisory information on a descriptor. Read more
source§

fn sync_data( &mut self, fd: Resource<Descriptor> ) -> Result<(), TrappableError<ErrorCode>>

Synchronize the data of a file to disk. Read more
source§

fn get_flags( &mut self, fd: Resource<Descriptor> ) -> Result<DescriptorFlags, TrappableError<ErrorCode>>

Get flags associated with a descriptor. Read more
source§

fn get_type( &mut self, fd: Resource<Descriptor> ) -> Result<DescriptorType, TrappableError<ErrorCode>>

Get the dynamic type of a descriptor. Read more
source§

fn set_size( &mut self, fd: Resource<Descriptor>, size: u64 ) -> Result<(), TrappableError<ErrorCode>>

Adjust the size of an open file. If this increases the file’s size, the extra bytes are filled with zeros. Read more
source§

fn set_times( &mut self, fd: Resource<Descriptor>, atim: NewTimestamp, mtim: NewTimestamp ) -> Result<(), TrappableError<ErrorCode>>

Adjust the timestamps of an open file or directory. Read more
source§

fn read( &mut self, fd: Resource<Descriptor>, len: u64, offset: u64 ) -> Result<(Vec<u8>, bool), TrappableError<ErrorCode>>

Read from a descriptor, without using and updating the descriptor’s offset. Read more
source§

fn write( &mut self, fd: Resource<Descriptor>, buf: Vec<u8>, offset: u64 ) -> Result<u64, TrappableError<ErrorCode>>

Write to a descriptor, without using and updating the descriptor’s offset. Read more
source§

fn read_directory( &mut self, fd: Resource<Descriptor> ) -> Result<Resource<ReaddirIterator>, TrappableError<ErrorCode>>

Read directory entries from a directory. Read more
source§

fn sync( &mut self, fd: Resource<Descriptor> ) -> Result<(), TrappableError<ErrorCode>>

Synchronize the data and metadata of a file to disk. Read more
source§

fn create_directory_at( &mut self, fd: Resource<Descriptor>, path: String ) -> Result<(), TrappableError<ErrorCode>>

Create a directory. Read more
source§

fn stat( &mut self, fd: Resource<Descriptor> ) -> Result<DescriptorStat, TrappableError<ErrorCode>>

Return the attributes of an open file or directory. Read more
source§

fn stat_at( &mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String ) -> Result<DescriptorStat, TrappableError<ErrorCode>>

Return the attributes of a file or directory. Read more
source§

fn set_times_at( &mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String, atim: NewTimestamp, mtim: NewTimestamp ) -> Result<(), TrappableError<ErrorCode>>

Adjust the timestamps of a file or directory. Read more
Create a hard link. Read more
source§

fn open_at( &mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String, oflags: OpenFlags, flags: DescriptorFlags ) -> Result<Resource<Descriptor>, TrappableError<ErrorCode>>

Open a file or directory. Read more
source§

fn drop(&mut self, fd: Resource<Descriptor>) -> Result<(), Error>

Read the contents of a symbolic link. Read more
source§

fn remove_directory_at( &mut self, fd: Resource<Descriptor>, path: String ) -> Result<(), TrappableError<ErrorCode>>

Remove a directory. Read more
source§

fn rename_at( &mut self, fd: Resource<Descriptor>, old_path: String, new_fd: Resource<Descriptor>, new_path: String ) -> Result<(), TrappableError<ErrorCode>>

Rename a filesystem object. Read more
Create a symbolic link (also known as a “symlink”). Read more
Unlink a filesystem object that is not a directory. Read more
source§

fn read_via_stream( &mut self, fd: Resource<Descriptor>, offset: u64 ) -> Result<Resource<InputStream>, TrappableError<ErrorCode>>

Return a stream for reading from a file, if available. Read more
source§

fn write_via_stream( &mut self, fd: Resource<Descriptor>, offset: u64 ) -> Result<Resource<Box<dyn HostOutputStream>>, TrappableError<ErrorCode>>

Return a stream for writing to a file, if available. Read more
source§

fn append_via_stream( &mut self, fd: Resource<Descriptor> ) -> Result<Resource<Box<dyn HostOutputStream>>, TrappableError<ErrorCode>>

Return a stream for appending to a file, if available. Read more
source§

fn is_same_object( &mut self, a: Resource<Descriptor>, b: Resource<Descriptor> ) -> Result<bool, Error>

Test whether two descriptors refer to the same filesystem object. Read more
source§

fn metadata_hash( &mut self, fd: Resource<Descriptor> ) -> Result<MetadataHashValue, TrappableError<ErrorCode>>

Return a hash of the metadata associated with a filesystem object referred to by a descriptor. Read more
source§

fn metadata_hash_at( &mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String ) -> Result<MetadataHashValue, TrappableError<ErrorCode>>

Return a hash of the metadata associated with a filesystem object referred to by a directory descriptor and a relative path. Read more
source§

impl<T> HostDescriptor for T
where T: WasiView,

source§

fn advise<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, offset: u64, len: u64, advice: Advice ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Provide file advisory information on a descriptor. Read more
source§

fn sync_data<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Synchronize the data of a file to disk. Read more
source§

fn get_flags<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<DescriptorFlags, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Get flags associated with a descriptor. Read more
source§

fn get_type<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<DescriptorType, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Get the dynamic type of a descriptor. Read more
source§

fn set_size<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, size: u64 ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Adjust the size of an open file. If this increases the file’s size, the extra bytes are filled with zeros. Read more
source§

fn set_times<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, atim: NewTimestamp, mtim: NewTimestamp ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Adjust the timestamps of an open file or directory. Read more
source§

fn read<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, len: u64, offset: u64 ) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, bool), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Read from a descriptor, without using and updating the descriptor’s offset. Read more
source§

fn write<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, buf: Vec<u8>, offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Write to a descriptor, without using and updating the descriptor’s offset. Read more
source§

fn read_directory<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<Resource<ReaddirIterator>, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Read directory entries from a directory. Read more
source§

fn sync<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Synchronize the data and metadata of a file to disk. Read more
source§

fn create_directory_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, path: String ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Create a directory. Read more
source§

fn stat<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<DescriptorStat, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Return the attributes of an open file or directory. Read more
source§

fn stat_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String ) -> Pin<Box<dyn Future<Output = Result<DescriptorStat, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Return the attributes of a file or directory. Read more
source§

fn set_times_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String, atim: NewTimestamp, mtim: NewTimestamp ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Adjust the timestamps of a file or directory. Read more
Create a hard link. Read more
source§

fn open_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String, oflags: OpenFlags, flags: DescriptorFlags ) -> Pin<Box<dyn Future<Output = Result<Resource<Descriptor>, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Open a file or directory. Read more
source§

fn drop(&mut self, fd: Resource<Descriptor>) -> Result<(), Error>

Read the contents of a symbolic link. Read more
source§

fn remove_directory_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, path: String ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Remove a directory. Read more
source§

fn rename_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, old_path: String, new_fd: Resource<Descriptor>, new_path: String ) -> Pin<Box<dyn Future<Output = Result<(), TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Rename a filesystem object. Read more
Create a symbolic link (also known as a “symlink”). Read more
Unlink a filesystem object that is not a directory. Read more
source§

fn read_via_stream( &mut self, fd: Resource<Descriptor>, offset: u64 ) -> Result<Resource<InputStream>, TrappableError<ErrorCode>>

Return a stream for reading from a file, if available. Read more
source§

fn write_via_stream( &mut self, fd: Resource<Descriptor>, offset: u64 ) -> Result<Resource<Box<dyn HostOutputStream>>, TrappableError<ErrorCode>>

Return a stream for writing to a file, if available. Read more
source§

fn append_via_stream( &mut self, fd: Resource<Descriptor> ) -> Result<Resource<Box<dyn HostOutputStream>>, TrappableError<ErrorCode>>

Return a stream for appending to a file, if available. Read more
source§

fn is_same_object<'life0, 'async_trait>( &'life0 mut self, a: Resource<Descriptor>, b: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Test whether two descriptors refer to the same filesystem object. Read more
source§

fn metadata_hash<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor> ) -> Pin<Box<dyn Future<Output = Result<MetadataHashValue, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Return a hash of the metadata associated with a filesystem object referred to by a descriptor. Read more
source§

fn metadata_hash_at<'life0, 'async_trait>( &'life0 mut self, fd: Resource<Descriptor>, path_flags: PathFlags, path: String ) -> Pin<Box<dyn Future<Output = Result<MetadataHashValue, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Return a hash of the metadata associated with a filesystem object referred to by a directory descriptor and a relative path. Read more
source§

impl<T> HostDirectoryEntryStream for T
where T: WasiView,

source§

fn read_directory_entry<'life0, 'async_trait>( &'life0 mut self, stream: Resource<ReaddirIterator> ) -> Pin<Box<dyn Future<Output = Result<Option<DirectoryEntry>, TrappableError<ErrorCode>>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Read a single directory entry from a directory-entry-stream.
source§

fn drop(&mut self, stream: Resource<ReaddirIterator>) -> Result<(), Error>

source§

impl<T> HostDirectoryEntryStream for T

source§

fn read_directory_entry( &mut self, stream: Resource<ReaddirIterator> ) -> Result<Option<DirectoryEntry>, TrappableError<ErrorCode>>

Read a single directory entry from a directory-entry-stream.
source§

fn drop(&mut self, stream: Resource<ReaddirIterator>) -> Result<(), Error>

source§

impl<T> HostError for T
where T: WasiView,

source§

fn drop(&mut self, err: Resource<Error>) -> Result<(), Error>

source§

fn to_debug_string(&mut self, err: Resource<Error>) -> Result<String, Error>

Returns a string that is suitable to assist humans in debugging this error. Read more
source§

impl<T> HostIncomingDatagramStream for T
where T: WasiView,

source§

fn receive( &mut self, this: Resource<IncomingDatagramStream>, max_results: u64 ) -> Result<Vec<IncomingDatagram>, TrappableError<ErrorCode>>

Receive messages on the socket. Read more
source§

fn subscribe( &mut self, this: Resource<IncomingDatagramStream> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the stream is ready to receive again. Read more
source§

fn drop(&mut self, this: Resource<IncomingDatagramStream>) -> Result<(), Error>

source§

impl<T> HostInputStream for T
where T: WasiView,

source§

fn drop(&mut self, stream: Resource<InputStream>) -> Result<(), Error>

source§

fn read( &mut self, stream: Resource<InputStream>, len: u64 ) -> Result<Vec<u8>, StreamError>

Perform a non-blocking read from the stream. Read more
source§

fn blocking_read( &mut self, stream: Resource<InputStream>, len: u64 ) -> Result<Vec<u8>, StreamError>

Read bytes from a stream, after blocking until at least one byte can be read. Except for blocking, behavior is identical to read.
source§

fn skip( &mut self, stream: Resource<InputStream>, len: u64 ) -> Result<u64, StreamError>

Skip bytes from a stream. Returns number of bytes skipped. Read more
source§

fn blocking_skip( &mut self, stream: Resource<InputStream>, len: u64 ) -> Result<u64, StreamError>

Skip bytes from a stream, after blocking until at least one byte can be skipped. Except for blocking behavior, identical to skip.
source§

fn subscribe( &mut self, stream: Resource<InputStream> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once either the specified stream has bytes available to read or the other end of the stream has been closed. The created pollable is a child resource of the input-stream. Implementations may trap if the input-stream is dropped before all derived pollables created with this function are dropped.
source§

impl<T> HostInputStream for T
where T: WasiView,

source§

fn drop(&mut self, stream: Resource<InputStream>) -> Result<(), Error>

source§

fn read<'life0, 'async_trait>( &'life0 mut self, stream: Resource<InputStream>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Perform a non-blocking read from the stream. Read more
source§

fn blocking_read<'life0, 'async_trait>( &'life0 mut self, stream: Resource<InputStream>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Read bytes from a stream, after blocking until at least one byte can be read. Except for blocking, behavior is identical to read.
source§

fn skip<'life0, 'async_trait>( &'life0 mut self, stream: Resource<InputStream>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Skip bytes from a stream. Returns number of bytes skipped. Read more
source§

fn blocking_skip<'life0, 'async_trait>( &'life0 mut self, stream: Resource<InputStream>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Skip bytes from a stream, after blocking until at least one byte can be skipped. Except for blocking behavior, identical to skip.
source§

fn subscribe( &mut self, stream: Resource<InputStream> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once either the specified stream has bytes available to read or the other end of the stream has been closed. The created pollable is a child resource of the input-stream. Implementations may trap if the input-stream is dropped before all derived pollables created with this function are dropped.
source§

impl<T> HostNetwork for T
where T: WasiView,

source§

fn drop(&mut self, this: Resource<Network>) -> Result<(), Error>

source§

impl<T> HostOutgoingDatagramStream for T
where T: WasiView,

source§

fn check_send( &mut self, this: Resource<OutgoingDatagramStream> ) -> Result<u64, TrappableError<ErrorCode>>

Check readiness for sending. This function never blocks. Read more
source§

fn send( &mut self, this: Resource<OutgoingDatagramStream>, datagrams: Vec<OutgoingDatagram> ) -> Result<u64, TrappableError<ErrorCode>>

Send messages on the socket. Read more
source§

fn subscribe( &mut self, this: Resource<OutgoingDatagramStream> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the stream is ready to send again. Read more
source§

fn drop(&mut self, this: Resource<OutgoingDatagramStream>) -> Result<(), Error>

source§

impl<T> HostOutputStream for T
where T: WasiView,

source§

fn drop( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<(), Error>

source§

fn check_write( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<u64, StreamError>

Check readiness for writing. This function never blocks. Read more
source§

fn write( &mut self, stream: Resource<Box<dyn HostOutputStream>>, bytes: Vec<u8> ) -> Result<(), StreamError>

Perform a write. This function never blocks. Read more
source§

fn subscribe( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the output-stream is ready for more writing, or an error has occured. When this pollable is ready, check-write will return ok(n) with n>0, or an error. Read more
source§

fn blocking_write_and_flush<'life0, 'async_trait>( &'life0 mut self, stream: Resource<Box<dyn HostOutputStream>>, bytes: Vec<u8> ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Perform a write of up to 4096 bytes, and then flush the stream. Block until all of these operations are complete, or an error occurs. Read more
source§

fn blocking_write_zeroes_and_flush<'life0, 'async_trait>( &'life0 mut self, stream: Resource<Box<dyn HostOutputStream>>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Perform a write of up to 4096 zeroes, and then flush the stream. Block until all of these operations are complete, or an error occurs. Read more
source§

fn write_zeroes( &mut self, stream: Resource<Box<dyn HostOutputStream>>, len: u64 ) -> Result<(), StreamError>

Write zeroes to a stream. Read more
source§

fn flush( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<(), StreamError>

Request to flush buffered output. This function never blocks. Read more
source§

fn blocking_flush<'life0, 'async_trait>( &'life0 mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Pin<Box<dyn Future<Output = Result<(), StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Request to flush buffered output, and block until flush completes and stream is ready for writing again.
source§

fn splice<'life0, 'async_trait>( &'life0 mut self, dest: Resource<Box<dyn HostOutputStream>>, src: Resource<InputStream>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Read from one stream and write to another. Read more
source§

fn blocking_splice<'life0, 'async_trait>( &'life0 mut self, dest: Resource<Box<dyn HostOutputStream>>, src: Resource<InputStream>, len: u64 ) -> Pin<Box<dyn Future<Output = Result<u64, StreamError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Read from one stream and write to another, with blocking. Read more
source§

impl<T> HostOutputStream for T
where T: WasiView,

source§

fn drop( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<(), Error>

source§

fn check_write( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<u64, StreamError>

Check readiness for writing. This function never blocks. Read more
source§

fn write( &mut self, stream: Resource<Box<dyn HostOutputStream>>, bytes: Vec<u8> ) -> Result<(), StreamError>

Perform a write. This function never blocks. Read more
source§

fn blocking_write_and_flush( &mut self, stream: Resource<Box<dyn HostOutputStream>>, bytes: Vec<u8> ) -> Result<(), StreamError>

Perform a write of up to 4096 bytes, and then flush the stream. Block until all of these operations are complete, or an error occurs. Read more
source§

fn blocking_write_zeroes_and_flush( &mut self, stream: Resource<Box<dyn HostOutputStream>>, len: u64 ) -> Result<(), StreamError>

Perform a write of up to 4096 zeroes, and then flush the stream. Block until all of these operations are complete, or an error occurs. Read more
source§

fn subscribe( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the output-stream is ready for more writing, or an error has occured. When this pollable is ready, check-write will return ok(n) with n>0, or an error. Read more
source§

fn write_zeroes( &mut self, stream: Resource<Box<dyn HostOutputStream>>, len: u64 ) -> Result<(), StreamError>

Write zeroes to a stream. Read more
source§

fn flush( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<(), StreamError>

Request to flush buffered output. This function never blocks. Read more
source§

fn blocking_flush( &mut self, stream: Resource<Box<dyn HostOutputStream>> ) -> Result<(), StreamError>

Request to flush buffered output, and block until flush completes and stream is ready for writing again.
source§

fn splice( &mut self, dst: Resource<Box<dyn HostOutputStream>>, src: Resource<InputStream>, len: u64 ) -> Result<u64, StreamError>

Read from one stream and write to another. Read more
source§

fn blocking_splice( &mut self, dst: Resource<Box<dyn HostOutputStream>>, src: Resource<InputStream>, len: u64 ) -> Result<u64, StreamError>

Read from one stream and write to another, with blocking. Read more
source§

impl<T> HostPollable for T
where T: WasiView,

source§

fn block<'life0, 'async_trait>( &'life0 mut self, pollable: Resource<Pollable> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

block returns immediately if the pollable is ready, and otherwise blocks until ready. Read more
source§

fn ready<'life0, 'async_trait>( &'life0 mut self, pollable: Resource<Pollable> ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Return the readiness of a pollable. This function never blocks. Read more
source§

fn drop(&mut self, pollable: Resource<Pollable>) -> Result<(), Error>

source§

impl<T> HostPollable for T
where T: WasiView,

source§

fn ready(&mut self, pollable: Resource<Pollable>) -> Result<bool, Error>

Return the readiness of a pollable. This function never blocks. Read more
source§

fn block(&mut self, pollable: Resource<Pollable>) -> Result<(), Error>

block returns immediately if the pollable is ready, and otherwise blocks until ready. Read more
source§

fn drop(&mut self, pollable: Resource<Pollable>) -> Result<(), Error>

source§

impl<T> HostResolveAddressStream for T
where T: WasiView,

source§

fn resolve_next_address( &mut self, resource: Resource<ResolveAddressStream> ) -> Result<Option<IpAddress>, TrappableError<ErrorCode>>

Returns the next address from the resolver. Read more
source§

fn subscribe( &mut self, resource: Resource<ResolveAddressStream> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the stream is ready for I/O. Read more
source§

fn drop( &mut self, resource: Resource<ResolveAddressStream> ) -> Result<(), Error>

source§

impl<T> HostTcpSocket for T
where T: WasiView,

source§

fn start_bind( &mut self, this: Resource<TcpSocket>, network: Resource<Network>, local_address: IpSocketAddress ) -> Result<(), TrappableError<ErrorCode>>

Bind the socket to a specific network on the provided IP address and port. Read more
source§

fn finish_bind( &mut self, this: Resource<TcpSocket> ) -> Result<(), TrappableError<ErrorCode>>

source§

fn start_connect( &mut self, this: Resource<TcpSocket>, network: Resource<Network>, remote_address: IpSocketAddress ) -> Result<(), TrappableError<ErrorCode>>

Connect to a remote endpoint. Read more
source§

fn finish_connect( &mut self, this: Resource<TcpSocket> ) -> Result<(Resource<InputStream>, Resource<Box<dyn HostOutputStream>>), TrappableError<ErrorCode>>

source§

fn start_listen( &mut self, this: Resource<TcpSocket> ) -> Result<(), TrappableError<ErrorCode>>

Start listening for new connections. Read more
source§

fn finish_listen( &mut self, this: Resource<TcpSocket> ) -> Result<(), TrappableError<ErrorCode>>

source§

fn accept( &mut self, this: Resource<TcpSocket> ) -> Result<(Resource<TcpSocket>, Resource<InputStream>, Resource<Box<dyn HostOutputStream>>), TrappableError<ErrorCode>>

Accept a new client socket. Read more
source§

fn local_address( &mut self, this: Resource<TcpSocket> ) -> Result<IpSocketAddress, TrappableError<ErrorCode>>

Get the bound local address. Read more
source§

fn remote_address( &mut self, this: Resource<TcpSocket> ) -> Result<IpSocketAddress, TrappableError<ErrorCode>>

Get the remote address. Read more
source§

fn is_listening(&mut self, this: Resource<TcpSocket>) -> Result<bool, Error>

Whether the socket is in the listening state. Read more
source§

fn address_family( &mut self, this: Resource<TcpSocket> ) -> Result<IpAddressFamily, Error>

Whether this is a IPv4 or IPv6 socket. Read more
source§

fn set_listen_backlog_size( &mut self, this: Resource<TcpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

Hints the desired listen queue size. Implementations are free to ignore this. Read more
source§

fn keep_alive_enabled( &mut self, this: Resource<TcpSocket> ) -> Result<bool, TrappableError<ErrorCode>>

Enables or disables keepalive. Read more
source§

fn set_keep_alive_enabled( &mut self, this: Resource<TcpSocket>, value: bool ) -> Result<(), TrappableError<ErrorCode>>

source§

fn keep_alive_idle_time( &mut self, this: Resource<TcpSocket> ) -> Result<u64, TrappableError<ErrorCode>>

Amount of time the connection has to be idle before TCP starts sending keepalive packets. Read more
source§

fn set_keep_alive_idle_time( &mut self, this: Resource<TcpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn keep_alive_interval( &mut self, this: Resource<TcpSocket> ) -> Result<u64, TrappableError<ErrorCode>>

The time between keepalive packets. Read more
source§

fn set_keep_alive_interval( &mut self, this: Resource<TcpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn keep_alive_count( &mut self, this: Resource<TcpSocket> ) -> Result<u32, TrappableError<ErrorCode>>

The maximum amount of keepalive packets TCP should send before aborting the connection. Read more
source§

fn set_keep_alive_count( &mut self, this: Resource<TcpSocket>, value: u32 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn hop_limit( &mut self, this: Resource<TcpSocket> ) -> Result<u8, TrappableError<ErrorCode>>

Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
source§

fn set_hop_limit( &mut self, this: Resource<TcpSocket>, value: u8 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn receive_buffer_size( &mut self, this: Resource<TcpSocket> ) -> Result<u64, TrappableError<ErrorCode>>

The kernel buffer space reserved for sends/receives on this socket. Read more
source§

fn set_receive_buffer_size( &mut self, this: Resource<TcpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn send_buffer_size( &mut self, this: Resource<TcpSocket> ) -> Result<u64, TrappableError<ErrorCode>>

source§

fn set_send_buffer_size( &mut self, this: Resource<TcpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn subscribe( &mut self, this: Resource<TcpSocket> ) -> Result<Resource<Pollable>, Error>

Create a pollable which can be used to poll for, or block on, completion of any of the asynchronous operations of this socket. Read more
source§

fn shutdown( &mut self, this: Resource<TcpSocket>, shutdown_type: ShutdownType ) -> Result<(), TrappableError<ErrorCode>>

Initiate a graceful shutdown. Read more
source§

fn drop(&mut self, this: Resource<TcpSocket>) -> Result<(), Error>

source§

impl<T> HostTerminalInput for T
where T: WasiView,

source§

impl<T> HostTerminalOutput for T
where T: WasiView,

source§

impl<T> HostUdpSocket for T
where T: WasiView,

source§

fn start_bind( &mut self, this: Resource<UdpSocket>, network: Resource<Network>, local_address: IpSocketAddress ) -> Result<(), TrappableError<ErrorCode>>

Bind the socket to a specific network on the provided IP address and port. Read more
source§

fn finish_bind( &mut self, this: Resource<UdpSocket> ) -> Result<(), TrappableError<ErrorCode>>

source§

fn stream( &mut self, this: Resource<UdpSocket>, remote_address: Option<IpSocketAddress> ) -> Result<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>), TrappableError<ErrorCode>>

Set up inbound & outbound communication channels, optionally to a specific peer. Read more
source§

fn local_address( &mut self, this: Resource<UdpSocket> ) -> Result<IpSocketAddress, TrappableError<ErrorCode>>

Get the current bound address. Read more
source§

fn remote_address( &mut self, this: Resource<UdpSocket> ) -> Result<IpSocketAddress, TrappableError<ErrorCode>>

Get the address the socket is currently streaming to. Read more
source§

fn address_family( &mut self, this: Resource<UdpSocket> ) -> Result<IpAddressFamily, Error>

Whether this is a IPv4 or IPv6 socket. Read more
source§

fn unicast_hop_limit( &mut self, this: Resource<UdpSocket> ) -> Result<u8, TrappableError<ErrorCode>>

Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
source§

fn set_unicast_hop_limit( &mut self, this: Resource<UdpSocket>, value: u8 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn receive_buffer_size( &mut self, this: Resource<UdpSocket> ) -> Result<u64, TrappableError<ErrorCode>>

The kernel buffer space reserved for sends/receives on this socket. Read more
source§

fn set_receive_buffer_size( &mut self, this: Resource<UdpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn send_buffer_size( &mut self, this: Resource<UdpSocket> ) -> Result<u64, TrappableError<ErrorCode>>

source§

fn set_send_buffer_size( &mut self, this: Resource<UdpSocket>, value: u64 ) -> Result<(), TrappableError<ErrorCode>>

source§

fn subscribe( &mut self, this: Resource<UdpSocket> ) -> Result<Resource<Pollable>, Error>

Create a pollable which will resolve once the socket is ready for I/O. Read more
source§

fn drop(&mut self, this: Resource<UdpSocket>) -> Result<(), Error>

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointee for T

§

type Pointer = u32

source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_> ) -> Result<(), Error>

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WasiSnapshotPreview1 for T
where T: WasiPreview1View + Host + Host + Host + Host + Host + Host + Host + Host + Host,

source§

fn fd_allocate(&mut self, fd: Fd, _offset: u64, _len: u64) -> Result<(), Error>

Force the allocation of space in a file. NOTE: This is similar to posix_fallocate in POSIX.

source§

fn fd_close<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Close a file descriptor. NOTE: This is similar to close in POSIX.

source§

fn fd_datasync<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Synchronize the data of a file to disk. NOTE: This is similar to fdatasync in POSIX.

source§

fn fd_fdstat_get<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<Fdstat, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Get the attributes of a file descriptor. NOTE: This returns similar flags to fsync(fd, F_GETFL) in POSIX, as well as additional fields.

source§

fn fd_fdstat_set_flags(&mut self, fd: Fd, flags: Fdflags) -> Result<(), Error>

Adjust the flags associated with a file descriptor. NOTE: This is similar to fcntl(fd, F_SETFL, flags) in POSIX.

source§

fn fd_fdstat_set_rights( &mut self, fd: Fd, _fs_rights_base: Rights, _fs_rights_inheriting: Rights ) -> Result<(), Error>

Does not do anything if fd corresponds to a valid descriptor and returns [types::Errno::Badf] error otherwise.

source§

fn fd_filestat_get<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Return the attributes of an open file.

source§

fn fd_filestat_set_size<'life0, 'async_trait>( &'life0 mut self, fd: Fd, size: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Adjust the size of an open file. If this increases the file’s size, the extra bytes are filled with zeros. NOTE: This is similar to ftruncate in POSIX.

source§

fn fd_filestat_set_times<'life0, 'async_trait>( &'life0 mut self, fd: Fd, atim: u64, mtim: u64, fst_flags: Fstflags ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Adjust the timestamps of an open file or directory. NOTE: This is similar to futimens in POSIX.

source§

fn fd_read<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, iovs: &'life1 GuestPtr<'a, [Iovec<'a>]> ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Read from a file descriptor. NOTE: This is similar to readv in POSIX.

source§

fn fd_pread<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, iovs: &'life1 GuestPtr<'a, [Iovec<'a>]>, offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Read from a file descriptor, without using and updating the file descriptor’s offset. NOTE: This is similar to preadv in POSIX.

source§

fn fd_write<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, ciovs: &'life1 GuestPtr<'a, [Ciovec<'a>]> ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Write to a file descriptor. NOTE: This is similar to writev in POSIX.

source§

fn fd_pwrite<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, ciovs: &'life1 GuestPtr<'a, [Ciovec<'a>]>, offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Write to a file descriptor, without using and updating the file descriptor’s offset. NOTE: This is similar to pwritev in POSIX.

source§

fn fd_prestat_get(&mut self, fd: Fd) -> Result<Prestat, Error>

Return a description of the given preopened file descriptor.

source§

fn fd_prestat_dir_name<'a>( &mut self, fd: Fd, path: &GuestPtr<'a, u8>, path_max_len: u32 ) -> Result<(), Error>

Return a description of the given preopened file descriptor.

source§

fn fd_renumber(&mut self, from: Fd, to: Fd) -> Result<(), Error>

Atomically replace a file descriptor by renumbering another file descriptor.

source§

fn fd_seek<'life0, 'async_trait>( &'life0 mut self, fd: Fd, offset: i64, whence: Whence ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Move the offset of a file descriptor. NOTE: This is similar to lseek in POSIX.

source§

fn fd_sync<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Synchronize the data and metadata of a file to disk. NOTE: This is similar to fsync in POSIX.

source§

fn fd_tell(&mut self, fd: Fd) -> Result<u64, Error>

Return the current offset of a file descriptor. NOTE: This is similar to lseek(fd, 0, SEEK_CUR) in POSIX.

source§

fn path_filestat_get<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, flags: Lookupflags, path: &'life1 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Return the attributes of a file or directory. NOTE: This is similar to stat in POSIX.

source§

fn path_filestat_set_times<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, flags: Lookupflags, path: &'life1 GuestPtr<'a, str>, atim: u64, mtim: u64, fst_flags: Fstflags ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Adjust the timestamps of a file or directory. NOTE: This is similar to utimensat in POSIX.

Create a hard link. NOTE: This is similar to linkat in POSIX.

source§

fn path_open<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, dirflags: Lookupflags, path: &'life1 GuestPtr<'a, str>, oflags: Oflags, fs_rights_base: Rights, _fs_rights_inheriting: Rights, fdflags: Fdflags ) -> Pin<Box<dyn Future<Output = Result<Fd, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

Open a file or directory. NOTE: This is similar to openat in POSIX.

Read the contents of a symbolic link. NOTE: This is similar to readlinkat in POSIX.

source§

fn path_rename<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, src_fd: Fd, src_path: &'life1 GuestPtr<'a, str>, dest_fd: Fd, dest_path: &'life2 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

Rename a file or directory. NOTE: This is similar to renameat in POSIX.

source§

fn args_get<'b>( &mut self, argv: &GuestPtr<'b, GuestPtr<'b, u8>>, argv_buf: &GuestPtr<'b, u8> ) -> Result<(), Error>

source§

fn args_sizes_get(&mut self) -> Result<(u32, u32), Error>

source§

fn environ_get<'b>( &mut self, environ: &GuestPtr<'b, GuestPtr<'b, u8>>, environ_buf: &GuestPtr<'b, u8> ) -> Result<(), Error>

source§

fn environ_sizes_get(&mut self) -> Result<(u32, u32), Error>

source§

fn clock_res_get(&mut self, id: Clockid) -> Result<u64, Error>

source§

fn clock_time_get(&mut self, id: Clockid, _precision: u64) -> Result<u64, Error>

source§

fn fd_advise<'life0, 'async_trait>( &'life0 mut self, fd: Fd, offset: u64, len: u64, advice: Advice ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_readdir<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, buf: &'life1 GuestPtr<'a, u8>, buf_len: u32, cookie: u64 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_create_directory<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, path: &'life1 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_remove_directory<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, path: &'life1 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn poll_oneoff<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, subs: &'life1 GuestPtr<'a, Subscription>, events: &'life2 GuestPtr<'a, Event>, nsubscriptions: u32 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

source§

fn proc_exit(&mut self, status: u32) -> Error

source§

fn proc_raise(&mut self, _sig: Signal) -> Result<(), Error>

source§

fn sched_yield(&mut self) -> Result<(), Error>

source§

fn random_get<'a>( &mut self, buf: &GuestPtr<'a, u8>, buf_len: u32 ) -> Result<(), Error>

source§

fn sock_accept(&mut self, fd: Fd, flags: Fdflags) -> Result<Fd, Error>

source§

fn sock_recv<'a>( &mut self, fd: Fd, ri_data: &GuestPtr<'a, [Iovec<'a>]>, ri_flags: Riflags ) -> Result<(u32, Roflags), Error>

source§

fn sock_send<'a>( &mut self, fd: Fd, si_data: &GuestPtr<'a, [Ciovec<'a>]>, _si_flags: u16 ) -> Result<u32, Error>

source§

fn sock_shutdown(&mut self, fd: Fd, how: Sdflags) -> Result<(), Error>

source§

impl<T> WasiUnstable for T

source§

fn args_get<'a>( &mut self, argv: &GuestPtr<'a, GuestPtr<'a, u8>>, argv_buf: &GuestPtr<'a, u8> ) -> Result<(), Error>

source§

fn args_sizes_get(&mut self) -> Result<(u32, u32), Error>

source§

fn environ_get<'a>( &mut self, environ: &GuestPtr<'a, GuestPtr<'a, u8>>, environ_buf: &GuestPtr<'a, u8> ) -> Result<(), Error>

source§

fn environ_sizes_get(&mut self) -> Result<(u32, u32), Error>

source§

fn clock_res_get(&mut self, id: Clockid) -> Result<u64, Error>

source§

fn clock_time_get(&mut self, id: Clockid, precision: u64) -> Result<u64, Error>

source§

fn fd_advise<'life0, 'async_trait>( &'life0 mut self, fd: Fd, offset: u64, len: u64, advice: Advice ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_allocate(&mut self, fd: Fd, offset: u64, len: u64) -> Result<(), Error>

source§

fn fd_close<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_datasync<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_fdstat_get<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<Fdstat, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_fdstat_set_flags(&mut self, fd: Fd, flags: Fdflags) -> Result<(), Error>

source§

fn fd_fdstat_set_rights( &mut self, fd: Fd, fs_rights_base: Rights, fs_rights_inheriting: Rights ) -> Result<(), Error>

source§

fn fd_filestat_get<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_filestat_set_size<'life0, 'async_trait>( &'life0 mut self, fd: Fd, size: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_filestat_set_times<'life0, 'async_trait>( &'life0 mut self, fd: Fd, atim: u64, mtim: u64, fst_flags: Fstflags ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_read<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, iovs: &'life1 GuestPtr<'a, [Iovec<'a>]> ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn fd_pread<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, iovs: &'life1 GuestPtr<'a, [Iovec<'a>]>, offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn fd_write<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, ciovs: &'life1 GuestPtr<'a, [Ciovec<'a>]> ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn fd_pwrite<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, ciovs: &'life1 GuestPtr<'a, [Ciovec<'a>]>, offset: u64 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn fd_prestat_get(&mut self, fd: Fd) -> Result<Prestat, Error>

source§

fn fd_prestat_dir_name( &mut self, fd: Fd, path: &GuestPtr<'_, u8>, path_max_len: u32 ) -> Result<(), Error>

source§

fn fd_renumber(&mut self, from: Fd, to: Fd) -> Result<(), Error>

source§

fn fd_seek<'life0, 'async_trait>( &'life0 mut self, fd: Fd, offset: i64, whence: Whence ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_sync<'life0, 'async_trait>( &'life0 mut self, fd: Fd ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

source§

fn fd_tell(&mut self, fd: Fd) -> Result<u64, Error>

source§

fn fd_readdir<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, fd: Fd, buf: &'life1 GuestPtr<'a, u8>, buf_len: u32, cookie: u64 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_create_directory<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, path: &'life1 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_filestat_get<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, flags: Lookupflags, path: &'life1 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<Filestat, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_filestat_set_times<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, flags: Lookupflags, path: &'life1 GuestPtr<'a, str>, atim: u64, mtim: u64, fst_flags: Fstflags ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_open<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, dirflags: Lookupflags, path: &'life1 GuestPtr<'a, str>, oflags: Oflags, fs_rights_base: Rights, fs_rights_inheriting: Rights, fdflags: Fdflags ) -> Pin<Box<dyn Future<Output = Result<Fd, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_remove_directory<'a, 'life0, 'life1, 'async_trait>( &'life0 mut self, dirfd: Fd, path: &'life1 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

source§

fn path_rename<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, src_fd: Fd, src_path: &'life1 GuestPtr<'a, str>, dest_fd: Fd, dest_path: &'life2 GuestPtr<'a, str> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

source§

fn poll_oneoff<'a, 'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, subs: &'life1 GuestPtr<'a, Subscription>, events: &'life2 GuestPtr<'a, Event>, nsubscriptions: u32 ) -> Pin<Box<dyn Future<Output = Result<u32, Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, T: 'async_trait,

source§

fn proc_exit(&mut self, status: u32) -> Error

source§

fn proc_raise(&mut self, sig: Signal) -> Result<(), Error>

source§

fn sched_yield(&mut self) -> Result<(), Error>

source§

fn random_get( &mut self, buf: &GuestPtr<'_, u8>, buf_len: u32 ) -> Result<(), Error>

source§

fn sock_recv( &mut self, _fd: Fd, _ri_data: &GuestPtr<'_, [Iovec<'_>]>, _ri_flags: Riflags ) -> Result<(u32, Roflags), Error>

source§

fn sock_send( &mut self, _fd: Fd, _si_data: &GuestPtr<'_, [Ciovec<'_>]>, _si_flags: u16 ) -> Result<u32, Error>

source§

fn sock_shutdown(&mut self, _fd: Fd, _how: Sdflags) -> Result<(), Error>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,

source§

impl<T> Host for T
where T: WasiView,