wasmtime_wasi::bindings::filesystem::types

Trait Host

Source
pub trait Host:
    Send
    + HostDescriptor
    + HostDirectoryEntryStream
    + Send {
    // Required methods
    fn filesystem_error_code(
        &mut self,
        err: Resource<Error>,
    ) -> Result<Option<ErrorCode>>;
    fn convert_error_code(&mut self, err: FsError) -> Result<ErrorCode>;
}

Required Methods§

Source

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

Attempts to extract a filesystem-related error-code from the stream error provided.

Stream operations which return stream-error::last-operation-failed have a payload with more information about the operation that failed. This payload can be passed through to this function to see if there’s filesystem-related information about the error to return.

Note that this function is fallible because not all stream-related errors are filesystem-related errors.

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

Source§

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

Attempts to extract a filesystem-related error-code from the stream error provided.

Stream operations which return stream-error::last-operation-failed have a payload with more information about the operation that failed. This payload can be passed through to this function to see if there’s filesystem-related information about the error to return.

Note that this function is fallible because not all stream-related errors are filesystem-related errors.

Source§

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

Implementors§

Source§

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