chore: clarify UDP on WASM
This commit is contained in:
parent
d08fe070d9
commit
0eca0f706c
|
@ -15,7 +15,7 @@ default = ["client", "rt-multi-thread"]
|
|||
backend = ["dep:poem", "dep:sqlx"]
|
||||
rt-multi-thread = ["tokio/rt-multi-thread"]
|
||||
rt = ["tokio/rt"]
|
||||
client = ["voice"]
|
||||
client = []
|
||||
voice = ["dep:discortp", "dep:crypto_secretbox"]
|
||||
|
||||
[dependencies]
|
||||
|
|
|
@ -128,7 +128,7 @@ pub mod instance;
|
|||
#[cfg(feature = "client")]
|
||||
pub mod ratelimiter;
|
||||
pub mod types;
|
||||
#[cfg(feature = "client")]
|
||||
#[cfg(all(feature = "client", feature = "voice"))]
|
||||
pub mod voice;
|
||||
|
||||
#[derive(Clone, Default, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
|
|
|
@ -1,19 +1,12 @@
|
|||
#[cfg(all(not(target_arch = "wasm32"), feature = "client"))]
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "voice"))]
|
||||
pub mod tokio;
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "client"))]
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "voice"))]
|
||||
pub use tokio::*;
|
||||
|
||||
#[cfg(all(target_arch = "wasm32", feature = "client"))]
|
||||
pub mod wasm;
|
||||
#[cfg(all(target_arch = "wasm32", feature = "client"))]
|
||||
pub use wasm::*;
|
||||
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "client"))]
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "voice"))]
|
||||
pub type UdpSocket = tokio::TokioSocket;
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "client"))]
|
||||
#[cfg(all(not(target_arch = "wasm32"), feature = "voice"))]
|
||||
pub type UdpBackend = tokio::TokioBackend;
|
||||
|
||||
#[cfg(all(target_arch = "wasm32", feature = "client"))]
|
||||
pub type UdpSocket = wasm::WasmSocket;
|
||||
#[cfg(all(target_arch = "wasm32", feature = "client"))]
|
||||
pub type UdpBackend = wasm::WasmBackend;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
compile_error!("UDP Voice support is not (and will likely never be) supported for WASM. This is because UDP cannot be used in the browser. We are however looking into Webrtc for WASM voice support.");
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
use std::net::SocketAddr;
|
||||
|
||||
// TODO: Add wasm websockets
|
||||
compile_error!("Udp voice support is not implemented yet for wasm.");
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct WasmBackend;
|
||||
|
||||
pub type WasmSocket;
|
||||
|
||||
impl WasmBackend {
|
||||
pub async fn connect(url: SocketAddr) -> Result<WasmSocket, VoiceUdpError> {}
|
||||
}
|
Loading…
Reference in New Issue