diff --git a/examples/gateway_observers.rs b/examples/gateway_observers.rs index d0ba9dd..acb8df9 100644 --- a/examples/gateway_observers.rs +++ b/examples/gateway_observers.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use chorus::gateway::{GatewayCapable, GatewayHandleCapable}; use chorus::{ self, - gateway::{Gateway, Observer}, + gateway::Observer, types::{GatewayIdentifyPayload, GatewayReady}, }; use std::{sync::Arc, time::Duration}; diff --git a/examples/gateway_simple.rs b/examples/gateway_simple.rs index b522b47..dbc26a4 100644 --- a/examples/gateway_simple.rs +++ b/examples/gateway_simple.rs @@ -1,7 +1,7 @@ use std::time::Duration; use chorus::gateway::{GatewayCapable, GatewayHandleCapable}; -use chorus::{self, gateway::Gateway, types::GatewayIdentifyPayload}; +use chorus::{self, types::GatewayIdentifyPayload}; use tokio::time::sleep; /// This example creates a simple gateway connection and a session with an Identify event diff --git a/src/api/auth/login.rs b/src/api/auth/login.rs index 027056a..208e94d 100644 --- a/src/api/auth/login.rs +++ b/src/api/auth/login.rs @@ -4,7 +4,7 @@ use reqwest::Client; use serde_json::to_string; use crate::errors::ChorusResult; -use crate::gateway::{Gateway, GatewayCapable, GatewayHandleCapable}; +use crate::gateway::{GatewayCapable, GatewayHandleCapable}; use crate::instance::{ChorusUser, Instance}; use crate::ratelimiter::ChorusRequest; use crate::types::{GatewayIdentifyPayload, LimitType, LoginResult, LoginSchema}; diff --git a/src/api/auth/register.rs b/src/api/auth/register.rs index fa5c59e..79a5bcc 100644 --- a/src/api/auth/register.rs +++ b/src/api/auth/register.rs @@ -3,7 +3,7 @@ use std::sync::{Arc, RwLock}; use reqwest::Client; use serde_json::to_string; -use crate::gateway::{Gateway, GatewayCapable, GatewayHandle, GatewayHandleCapable}; +use crate::gateway::{GatewayCapable, GatewayHandleCapable}; use crate::types::GatewayIdentifyPayload; use crate::{ errors::ChorusResult, diff --git a/src/instance.rs b/src/instance.rs index ada99a6..4acfd26 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -9,11 +9,11 @@ use reqwest::Client; use serde::{Deserialize, Serialize}; use crate::errors::ChorusResult; -use crate::gateway::{Gateway, GatewayCapable, GatewayHandle}; +use crate::gateway::GatewayCapable; use crate::ratelimiter::ChorusRequest; use crate::types::types::subconfigs::limits::rates::RateLimits; use crate::types::{GeneralConfiguration, Limit, LimitType, User, UserSettings}; -use crate::UrlBundle; +use crate::{Gateway, GatewayHandle, UrlBundle}; #[derive(Debug, Clone, Default)] /// The [`Instance`]; what you will be using to perform all sorts of actions on the Spacebar server. diff --git a/src/lib.rs b/src/lib.rs index 47bbaab..e7fab0e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,6 +17,11 @@ #[cfg(all(feature = "rt", feature = "rt_multi_thread"))] compile_error!("feature \"rt\" and feature \"rt_multi_thread\" cannot be enabled at the same time"); +pub type Gateway = WebsocketGateway; +pub type GatewayHandle = WebsocketGatewayHandle; + +use gateway::Gateway as WebsocketGateway; +use gateway::GatewayHandle as WebsocketGatewayHandle; use url::{ParseError, Url}; #[cfg(feature = "client")] diff --git a/src/types/entities/channel.rs b/src/types/entities/channel.rs index 280401c..66768bd 100644 --- a/src/types/entities/channel.rs +++ b/src/types/entities/channel.rs @@ -15,7 +15,7 @@ use crate::types::{ use crate::types::Composite; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use chorus_macros::{observe_option_vec, Composite, Updateable}; diff --git a/src/types/entities/emoji.rs b/src/types/entities/emoji.rs index 4f56af5..301b0be 100644 --- a/src/types/entities/emoji.rs +++ b/src/types/entities/emoji.rs @@ -10,7 +10,7 @@ use crate::types::Snowflake; use crate::types::Composite; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use chorus_macros::{Composite, Updateable}; diff --git a/src/types/entities/guild.rs b/src/types/entities/guild.rs index bb4db0c..a3c2182 100644 --- a/src/types/entities/guild.rs +++ b/src/types/entities/guild.rs @@ -16,7 +16,7 @@ use bitflags::bitflags; use super::PublicUser; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use chorus_macros::{observe_option_vec, observe_vec, Composite, Updateable}; diff --git a/src/types/entities/mod.rs b/src/types/entities/mod.rs index a14ef2c..8d788c4 100644 --- a/src/types/entities/mod.rs +++ b/src/types/entities/mod.rs @@ -24,7 +24,7 @@ pub use voice_state::*; pub use webhook::*; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use async_trait::async_trait; diff --git a/src/types/entities/role.rs b/src/types/entities/role.rs index 087a775..349af02 100644 --- a/src/types/entities/role.rs +++ b/src/types/entities/role.rs @@ -9,7 +9,7 @@ use crate::types::utils::Snowflake; use chorus_macros::{Composite, Updateable}; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use crate::types::Composite; diff --git a/src/types/entities/user.rs b/src/types/entities/user.rs index eca5344..016a617 100644 --- a/src/types/entities/user.rs +++ b/src/types/entities/user.rs @@ -5,7 +5,7 @@ use serde_aux::prelude::deserialize_option_number_from_string; use std::fmt::Debug; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use crate::types::Composite; diff --git a/src/types/entities/voice_state.rs b/src/types/entities/voice_state.rs index 1c36268..569bbc7 100644 --- a/src/types/entities/voice_state.rs +++ b/src/types/entities/voice_state.rs @@ -7,7 +7,7 @@ use chorus_macros::Composite; use crate::types::Composite; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; diff --git a/src/types/entities/webhook.rs b/src/types/entities/webhook.rs index b544ec9..9560d89 100644 --- a/src/types/entities/webhook.rs +++ b/src/types/entities/webhook.rs @@ -4,7 +4,7 @@ use std::sync::{Arc, RwLock}; use serde::{Deserialize, Serialize}; #[cfg(feature = "client")] -use crate::gateway::{GatewayHandle, Updateable}; +use crate::gateway::Updateable; #[cfg(feature = "client")] use chorus_macros::{Composite, Updateable};