This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(func $App_SpinHttpWorld_wit_exports_wasi_http_v0_2_0_AppJsonSerializerContext__global__System_Text_Json_Serialization_Metadata_IJsonTypeInfoResolver_GetTypeInfo (;20990;) (type 6) (param i32 i32 i32 | |
i32) (result i32) | |
(local i32) | |
block ;; label = @1 | |
block ;; label = @2 | |
block ;; label = @3 | |
local.get 2 | |
i32.const 2670040 | |
i32.eq | |
br_if 0 (;@3;) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn for_any<F, R, T>(fun: F) -> F | |
where | |
F: FnOnce(StoreContextMut<T>) -> R + 'static, | |
R: 'static, | |
{ | |
fun | |
} | |
pub fn for_any_future<F, R, T, FF>(fut: FF) -> FF | |
where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface handler { | |
use types.{request, response, error-code}; | |
handle: func( | |
request: request, | |
) -> result<response, error-code>; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Somewhere in Wasmtime: | |
thread_local! { | |
static LOCAL_STORE: Cell<*mut dyn VMStore> = Cell::new(ptr::null_mut()); | |
} | |
pub struct LocalStore<'a, T> { | |
// We only use `T` in the `with` method below. | |
_phatom_type: PhantomData<T>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thread_local! { | |
static FINISH_HOST: std::cell::Cell<*mut u8> = std::cell::Cell::new(std::ptr::null_mut()); | |
static FINISH_SPAWNED: std::cell::RefCell<Vec<std::pin::Pin<Box<dyn std::future::Future<Output = wasmtime::component::HostTaskOutput> + Send + Sync + 'static>>>> = std::cell::RefCell::new(Vec::new()); | |
} | |
fn poll<T, G: for<'a> GetHost<&'a mut T>, F: std::future::Future + ?Sized>( | |
getter: G, | |
store: wasmtime::VMStoreRawPtr, | |
cx: &mut std::task::Context, | |
future: std::pin::Pin<&mut F>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// `request-write-result` will produce an error if the _caller_ has trouble writing | |
/// the request body or trailers. | |
/// | |
/// The returned `future` will produce an error if the _callee_ has trouble writing | |
/// the response body or trailers. | |
handle: func(request: request, request-write-result: future<result<_, error-code>>) | |
-> result<tuple<response, future<result<_, error-code>>>, error-code>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct StoreToken<T> { | |
id: StoreId, | |
_phantom: PhantomData<fn() -> T>, | |
} | |
impl<T> StoreToken<T> { | |
pub fn new(store: StoreContextMut<T>) -> Self { | |
Self { id: store.id(), _phantom: PhantomData } | |
} | |
OlderNewer