Skip to main content

wasmtime_wasi_tls/p2/
mod.rs

1use crate::{WasiTls, WasiTlsView};
2
3pub mod bindings;
4mod host;
5mod io;
6
7pub use bindings::types::LinkOptions;
8pub use host::{HostClientConnection, HostClientHandshake, HostFutureClientStreams};
9
10/// Add the `wasi-tls` world's types to a [`wasmtime::component::Linker`].
11pub fn add_to_linker<T>(
12    l: &mut wasmtime::component::Linker<T>,
13    opts: &LinkOptions,
14) -> wasmtime::Result<()>
15where
16    T: WasiTlsView + 'static,
17{
18    bindings::types::add_to_linker::<_, WasiTls>(l, &opts, T::tls)?;
19    Ok(())
20}