pub struct LarkClientBuilder { /* private fields */ }Expand description
飞书客户端构建器
使用构建器模式配置和创建LarkClient实例。支持链式调用配置各种选项。
§示例
use open_lark::prelude::*;
let client = LarkClient::builder("app_id", "app_secret")
.with_app_type(AppType::SelfBuild)
.with_enable_token_cache(true)
.with_req_timeout(Some(30.0))
.build();Implementations§
Source§impl LarkClientBuilder
impl LarkClientBuilder
Sourcepub fn with_app_type(self, app_type: AppType) -> Self
pub fn with_app_type(self, app_type: AppType) -> Self
Sourcepub fn with_marketplace_app(self) -> Self
pub fn with_marketplace_app(self) -> Self
设置为商店应用(等同于 with_app_type(AppType::Marketplace))
Sourcepub fn with_open_base_url(self, base_url: String) -> Self
pub fn with_open_base_url(self, base_url: String) -> Self
Sourcepub fn with_enable_token_cache(self, enable: bool) -> Self
pub fn with_enable_token_cache(self, enable: bool) -> Self
Sourcepub fn with_req_timeout(self, timeout: Option<f32>) -> Self
pub fn with_req_timeout(self, timeout: Option<f32>) -> Self
Sourcepub fn build(self) -> LarkClient
pub fn build(self) -> LarkClient
构建LarkClient实例
根据配置的参数创建最终的客户端实例。
Auto Trait Implementations§
impl Freeze for LarkClientBuilder
impl !RefUnwindSafe for LarkClientBuilder
impl Send for LarkClientBuilder
impl Sync for LarkClientBuilder
impl Unpin for LarkClientBuilder
impl !UnwindSafe for LarkClientBuilder
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