pub struct Config {Show 15 fields
pub api_key: String,
pub verified_bot_key: Option<String>,
pub verified_bot_key_api_key: Option<String>,
pub api_url: String,
pub socket_url: String,
pub subscribe_url: String,
pub subscription_auth_url: String,
pub rate_limiter: Arc<Mutex<RateLimiter>>,
pub socket: Box<dyn Socket>,
pub client: Box<dyn Client>,
pub headers: Headers,
pub now: fn() -> u64,
pub sleep: fn(Duration) -> Pin<Box<dyn Future<Output = ()> + Send + Sync>>,
pub sleep_sync: fn(Duration),
pub user_agent: String,
}
Fields§
§api_key: String
§verified_bot_key: Option<String>
§verified_bot_key_api_key: Option<String>
§api_url: String
§socket_url: String
§subscribe_url: String
§subscription_auth_url: String
§rate_limiter: Arc<Mutex<RateLimiter>>
§socket: Box<dyn Socket>
§client: Box<dyn Client>
§headers: Headers
§now: fn() -> u64
§sleep: fn(Duration) -> Pin<Box<dyn Future<Output = ()> + Send + Sync>>
§sleep_sync: fn(Duration)
§user_agent: String
Implementations§
Source§impl Config
impl Config
pub fn update_headers(self) -> Self
pub fn set_api_key(self, api_key: String) -> Self
pub fn set_verified_bot_key(self, verified_bot_key: String) -> Self
pub fn set_verified_bot_key_api_key( self, verified_bot_key_api_key: String, ) -> Self
pub fn set_api_url(self, api_url: String) -> Self
pub fn set_socket_url(self, socket_url: String) -> Self
pub fn set_subscribe_url(self, subscriptions_url: String) -> Self
pub fn set_subscription_auth_url(self, subscription_auth_url: String) -> Self
pub fn set_rate_limiter(self, rate_limiter: RateLimiter) -> Self
pub fn set_socket(self, socket: Box<dyn Socket>) -> Self
pub fn set_client(self, client: Box<dyn Client>) -> Self
pub fn set_now(self, now: fn() -> u64) -> Self
pub fn set_sleep( self, sleep: fn(Duration) -> Pin<Box<dyn Future<Output = ()> + Send + Sync>>, ) -> Self
pub fn set_sleep_sync(self, sleep_sync: fn(Duration)) -> Self
pub fn set_user_agent(self, user_agent: String) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more