pub trait CredentialProvider:
DynClone
+ Debug
+ Sync
+ Send {
// Required method
fn get(&self, opts: GetOptions) -> Result<GotCredential, Error>;
// Provided method
fn async_get(
&self,
opts: GetOptions,
) -> Pin<Box<dyn Future<Output = Result<GotCredential, Error>> + Send + '_>> { ... }
}
Expand description
认证信息获取接口
Required Methods§
Sourcefn get(&self, opts: GetOptions) -> Result<GotCredential, Error>
fn get(&self, opts: GetOptions) -> Result<GotCredential, Error>
返回七牛认证信息
该方法的异步版本为 Self::async_get
。
Provided Methods§
Sourcefn async_get(
&self,
opts: GetOptions,
) -> Pin<Box<dyn Future<Output = Result<GotCredential, Error>> + Send + '_>>
fn async_get( &self, opts: GetOptions, ) -> Pin<Box<dyn Future<Output = Result<GotCredential, Error>> + Send + '_>>
异步返回七牛认证信息