reorganize files

This commit is contained in:
bitfl0wer 2023-11-19 21:21:34 +01:00
parent 6fd6bdcbbc
commit 73342d5dd7
3 changed files with 12 additions and 10 deletions

View File

@ -0,0 +1,9 @@
#[cfg(not(target_arch = "wasm32"))]
pub mod tungstenite;
#[cfg(not(target_arch = "wasm32"))]
pub type Sink = tungstenite::TungsteniteSink;
#[cfg(not(target_arch = "wasm32"))]
pub type Stream = tungstenite::TungsteniteStream;
#[cfg(not(target_arch = "wasm32"))]
pub type WebSocketBackend = tungstenite::TungsteniteBackend;

View File

@ -7,8 +7,8 @@ use tokio_tungstenite::{
connect_async_tls_with_config, tungstenite, Connector, MaybeTlsStream, WebSocketStream, connect_async_tls_with_config, tungstenite, Connector, MaybeTlsStream, WebSocketStream,
}; };
use super::GatewayMessage;
use crate::errors::GatewayError; use crate::errors::GatewayError;
use crate::gateway::GatewayMessage;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct TungsteniteBackend; pub struct TungsteniteBackend;

View File

@ -1,13 +1,13 @@
use async_trait::async_trait; use async_trait::async_trait;
#[cfg(not(target_arch = "wasm32"))] pub mod backends;
pub mod backend_tungstenite;
pub mod events; pub mod events;
pub mod gateway; pub mod gateway;
pub mod handle; pub mod handle;
pub mod heartbeat; pub mod heartbeat;
pub mod message; pub mod message;
pub use backends::*;
pub use gateway::*; pub use gateway::*;
pub use handle::*; pub use handle::*;
use heartbeat::*; use heartbeat::*;
@ -22,13 +22,6 @@ use std::sync::{Arc, RwLock};
use tokio::sync::Mutex; use tokio::sync::Mutex;
#[cfg(not(target_arch = "wasm32"))]
pub type Sink = backend_tungstenite::TungsteniteSink;
#[cfg(not(target_arch = "wasm32"))]
pub type Stream = backend_tungstenite::TungsteniteStream;
#[cfg(not(target_arch = "wasm32"))]
pub type WebSocketBackend = backend_tungstenite::TungsteniteBackend;
// Gateway opcodes // Gateway opcodes
/// Opcode received when the server dispatches a [crate::types::WebSocketEvent] /// Opcode received when the server dispatches a [crate::types::WebSocketEvent]
const GATEWAY_DISPATCH: u8 = 0; const GATEWAY_DISPATCH: u8 = 0;