This code demonstrates with fewest dependencies how to connect metamask and other eip-1193 compatible wallets in webassembly with rust (no javascript). Currently the web3 helper library (which performs tasks such as call bytecode serialisation etc) is rust-web3, as ethers-rs lacks support for an eip-1193 transport, but I have manually written a transport in other examples, so I could PR this functionality if there is a demand.
# enter a nix flake shell (if you're using nixos, else install rust manually)
nix develop
# run trunk
trunk serve