It seems it is currently not possible to access the Env inside functions exposed via #[wasm_bindgen] and used in Workers RPC. This limitation makes it difficult to use RPC endpoints for any functionality that depends on environment bindings (e.g., Hyperdrive, secrets, KV, etc.).
#[wasm_bindgen]
pub async fn add(a: u32, b: u32) -> u32 {
// Access Env somehow....
a + b
}
There should be a way to access the Env, similar to how it is provided to the fetch handler.