pub struct Config {
pub network: Network,
pub custom_url: Option<String>,
pub auth: Option<AuthConfig>,
pub timeout: Duration,
pub rate_limit: Quota,
}Expand description
Configuration options for the Koios client
Fields§
§network: NetworkNetwork to connect to
custom_url: Option<String>Optional custom base URL (overrides network URL)
auth: Option<AuthConfig>Authentication configuration (if required)
timeout: DurationRequest timeout
rate_limit: QuotaRate limiting quota
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(
network: Network,
custom_url: Option<String>,
auth: Option<AuthConfig>,
timeout: Duration,
rate_limit: Quota,
) -> Self
pub fn new( network: Network, custom_url: Option<String>, auth: Option<AuthConfig>, timeout: Duration, rate_limit: Quota, ) -> Self
Create a new configuration with custom settings
Sourcepub fn with_auth_expiry(self, token: String, expiry: DateTime<Utc>) -> Self
pub fn with_auth_expiry(self, token: String, expiry: DateTime<Utc>) -> Self
Add authentication with expiry to the configuration
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set request timeout
Sourcepub fn with_rate_limit(self, rate_limit: Quota) -> Self
pub fn with_rate_limit(self, rate_limit: Quota) -> Self
Set rate limit quota
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