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