Remove all imports of Gateway and GatewayHandle

This commit is contained in:
bitfl0wer 2023-11-15 20:56:58 +01:00
parent 9ac36ab8e8
commit e4cc201b79
14 changed files with 19 additions and 14 deletions

View File

@ -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};

View File

@ -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

View File

@ -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};

View File

@ -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,

View File

@ -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.

View File

@ -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")]

View File

@ -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};

View File

@ -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};

View File

@ -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};

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -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};