Struct Config

Source
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

Source

pub fn update_headers(self) -> Self

Source

pub fn set_api_key(self, api_key: String) -> Self

Source

pub fn set_verified_bot_key(self, verified_bot_key: String) -> Self

Source

pub fn set_verified_bot_key_api_key( self, verified_bot_key_api_key: String, ) -> Self

Source

pub fn set_api_url(self, api_url: String) -> Self

Source

pub fn set_socket_url(self, socket_url: String) -> Self

Source

pub fn set_subscribe_url(self, subscriptions_url: String) -> Self

Source

pub fn set_subscription_auth_url(self, subscription_auth_url: String) -> Self

Source

pub fn set_rate_limiter(self, rate_limiter: RateLimiter) -> Self

Source

pub fn set_socket(self, socket: Box<dyn Socket>) -> Self

Source

pub fn set_client(self, client: Box<dyn Client>) -> Self

Source

pub fn set_now(self, now: fn() -> u64) -> Self

Source

pub fn set_sleep( self, sleep: fn(Duration) -> Pin<Box<dyn Future<Output = ()> + Send + Sync>>, ) -> Self

Source

pub fn set_sleep_sync(self, sleep_sync: fn(Duration)) -> Self

Source

pub fn set_user_agent(self, user_agent: String) -> Self

Trait Implementations§

Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.