pub struct ConfigBuilder { /* private fields */ }Expand description
配置构建器
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn app_secret(self, app_secret: impl Into<String>) -> Self
pub fn app_secret(self, app_secret: impl Into<String>) -> Self
设置应用密钥
Sourcepub fn enable_token_cache(self, enable: bool) -> Self
pub fn enable_token_cache(self, enable: bool) -> Self
设置是否启用令牌缓存
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
设置 HTTP 客户端
Sourcepub fn optimized_http_client(
self,
config: OptimizedHttpConfig,
) -> Result<Self, Error>
pub fn optimized_http_client( self, config: OptimizedHttpConfig, ) -> Result<Self, Error>
使用优化的HTTP配置构建客户端
Sourcepub fn production_http_client(self) -> Result<Self, Error>
pub fn production_http_client(self) -> Result<Self, Error>
使用生产环境优化配置
Sourcepub fn high_throughput_http_client(self) -> Result<Self, Error>
pub fn high_throughput_http_client(self) -> Result<Self, Error>
使用高吞吐量配置
Sourcepub fn low_latency_http_client(self) -> Result<Self, Error>
pub fn low_latency_http_client(self) -> Result<Self, Error>
使用低延迟配置
Sourcepub fn req_timeout(self, timeout: Duration) -> Self
pub fn req_timeout(self, timeout: Duration) -> Self
设置请求超时时间
Sourcepub fn token_provider(self, provider: impl TokenProvider + 'static) -> Self
pub fn token_provider(self, provider: impl TokenProvider + 'static) -> Self
设置令牌提供者
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ConfigBuilder
impl Default for ConfigBuilder
Source§fn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl !RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl !UnwindSafe for ConfigBuilder
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