pub struct OtsClientBuilder { /* private fields */ }
Expand description
客户端构建器
§Examples
let builder = OtsClient.builder("aid", "asec").endpoint("").instance_name("");
let client = builder.build();
Implementations§
Source§impl OtsClientBuilder
impl OtsClientBuilder
pub fn new(ak_id: impl AsRef<str>, ak_sec: impl AsRef<str>) -> Self
Sourcepub fn rety_policy(self, policy: Box<dyn RetryPolicy>) -> Self
pub fn rety_policy(self, policy: Box<dyn RetryPolicy>) -> Self
设置重试策略
Sourcepub fn instance_name(self, instance_name: impl AsRef<str>) -> Self
pub fn instance_name(self, instance_name: impl AsRef<str>) -> Self
设置实例名称
Sourcepub fn endpoint(self, endpoint: impl AsRef<str>) -> Self
pub fn endpoint(self, endpoint: impl AsRef<str>) -> Self
设置 endpoint。例如:https://instance-name.cn-beijing.ots.aliyuncs.com
Sourcepub fn http_client(self, client: Client) -> Self
pub fn http_client(self, client: Client) -> Self
设置自定义的 Client
Sourcepub fn retry_policy_mut(&mut self) -> &mut Box<dyn RetryPolicy>
pub fn retry_policy_mut(&mut self) -> &mut Box<dyn RetryPolicy>
获取重试策略的可写引用
pub fn build(self) -> OtsClient
Trait Implementations§
Source§impl Clone for OtsClientBuilder
impl Clone for OtsClientBuilder
Source§fn clone(&self) -> OtsClientBuilder
fn clone(&self) -> OtsClientBuilder
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 moreAuto Trait Implementations§
impl Freeze for OtsClientBuilder
impl !RefUnwindSafe for OtsClientBuilder
impl Send for OtsClientBuilder
impl Sync for OtsClientBuilder
impl Unpin for OtsClientBuilder
impl !UnwindSafe for OtsClientBuilder
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