pub struct Host { /* private fields */ }Expand description
The T in Store<T> for what the CLI is running.
This structures has a number of contexts used for various WASI proposals.
Note that all of them are optional meaning that they’re None by default
and enabled with various CLI flags (some CLI flags are on-by-default). Note
additionally that this structure is Clone to implement the wasi-threads
proposal. Many WASI proposals are not compatible with wasi-threads so to
model this Arc and Arc<Mutex<T>> is used for many configurations. If a
WASI proposal is inherently threadsafe it’s protected with just an Arc to
share its configuration across many threads.
If mutation is required then Mutex is used. Note though that the mutex is
not actually locked as access always goes through Arc::get_mut which
effectively asserts that there’s only one thread. In short much of this is
not compatible with wasi-threads.
Trait Implementations§
Source§impl WasiHttpView for Host
Available on crate feature wasi-http only.
impl WasiHttpView for Host
wasi-http only.Source§fn ctx(&mut self) -> &mut WasiHttpCtx
fn ctx(&mut self) -> &mut WasiHttpCtx
Source§fn table(&mut self) -> &mut ResourceTable
fn table(&mut self) -> &mut ResourceTable
Source§fn outgoing_body_buffer_chunks(&mut self) -> usize
fn outgoing_body_buffer_chunks(&mut self) -> usize
Source§fn outgoing_body_chunk_size(&mut self) -> usize
fn outgoing_body_chunk_size(&mut self) -> usize
Source§fn new_incoming_request<B>(
&mut self,
scheme: Scheme,
req: Request<B>,
) -> Result<Resource<HostIncomingRequest>, Error>
fn new_incoming_request<B>( &mut self, scheme: Scheme, req: Request<B>, ) -> Result<Resource<HostIncomingRequest>, Error>
Source§fn new_response_outparam(
&mut self,
result: Sender<Result<Response<BoxBody<Bytes, ErrorCode>>, ErrorCode>>,
) -> Result<Resource<HostResponseOutparam>, Error>
fn new_response_outparam( &mut self, result: Sender<Result<Response<BoxBody<Bytes, ErrorCode>>, ErrorCode>>, ) -> Result<Resource<HostResponseOutparam>, Error>
Source§fn send_request(
&mut self,
request: Request<BoxBody<Bytes, ErrorCode>>,
config: OutgoingRequestConfig,
) -> Result<HostFutureIncomingResponse, HttpError>
fn send_request( &mut self, request: Request<BoxBody<Bytes, ErrorCode>>, config: OutgoingRequestConfig, ) -> Result<HostFutureIncomingResponse, HttpError>
Source§fn is_forbidden_header(&mut self, name: &HeaderName) -> bool
fn is_forbidden_header(&mut self, name: &HeaderName) -> bool
Source§impl WasiHttpView for Host
Available on crate features wasi-http and component-model-async only.
impl WasiHttpView for Host
wasi-http and component-model-async only.Source§fn http(&mut self) -> WasiHttpCtxView<'_>
fn http(&mut self) -> WasiHttpCtxView<'_>
Auto Trait Implementations§
impl Freeze for Host
impl !RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl !UnwindSafe for Host
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more