pub struct ClientBuilder { /* private fields */ }Expand description
客户端构建器
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn view_width(self, width: usize) -> Self
pub fn view_width(self, width: usize) -> Self
设置默认视图宽度
Sourcepub fn development(self, dev: bool) -> Self
pub fn development(self, dev: bool) -> Self
设置开发模式
Sourcepub fn config(self, config: ClientConfig) -> Self
pub fn config(self, config: ClientConfig) -> Self
设置完整配置
Sourcepub fn auth<A: Authenticator + 'static>(self, auth: A) -> Self
pub fn auth<A: Authenticator + 'static>(self, auth: A) -> Self
使用自定义认证器(高级用法)
如果不设置,将使用默认的 TqAuth
§示例
let mut auth = TqAuth::new("username".to_string(), "password".to_string());
auth.login().await?;
let client = Client::builder("username", "password")
.auth(auth)
.build()
.await?;Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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