pub trait UploadTokenProvider: DynClone + Debug + Sync + Send {
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>;
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>;
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>;
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>> { ... }
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>> { ... }
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>> { ... }
}Expand description
上传凭证获取接口
可以阅读 https://developer.qiniu.com/kodo/manual/1208/upload-token 了解七牛安全机制。
Required Methods
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
从上传凭证内获取 AccessKey
该方法的异步版本为 Self::async_access_key。
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
从上传凭证内获取上传策略
该方法的异步版本为 Self::async_policy。
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
生成字符串
该方法的异步版本为 Self::async_to_token_string。
Provided Methods
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
async only.异步从上传凭证内获取 AccessKey
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
async only.异步从上传凭证内获取上传策略
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
async only.异步生成字符串
Implementations on Foreign Types
sourceimpl<'a, T: 'a + UploadTokenProvider + ?Sized> UploadTokenProvider for &'a T where
&'a T: DynClone + Debug + Sync + Send,
impl<'a, T: 'a + UploadTokenProvider + ?Sized> UploadTokenProvider for &'a T where
&'a T: DynClone + Debug + Sync + Send,
sourcefn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
从上传凭证内获取 AccessKey
该方法的异步版本为 [Self::async_access_key]。
sourcefn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
Available on crate feature async only.
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
async only.异步从上传凭证内获取 AccessKey
sourcefn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
从上传凭证内获取上传策略
该方法的异步版本为 [Self::async_policy]。
sourcefn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
Available on crate feature async only.
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
async only.异步从上传凭证内获取上传策略
sourcefn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
生成字符串
该方法的异步版本为 [Self::async_to_token_string]。
sourcefn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
Available on crate feature async only.
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
async only.异步生成字符串
sourceimpl<'a, T: 'a + UploadTokenProvider + ?Sized> UploadTokenProvider for &'a mut T where
&'a mut T: DynClone + Debug + Sync + Send,
impl<'a, T: 'a + UploadTokenProvider + ?Sized> UploadTokenProvider for &'a mut T where
&'a mut T: DynClone + Debug + Sync + Send,
sourcefn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
从上传凭证内获取 AccessKey
该方法的异步版本为 [Self::async_access_key]。
sourcefn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
Available on crate feature async only.
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
async only.异步从上传凭证内获取 AccessKey
sourcefn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
从上传凭证内获取上传策略
该方法的异步版本为 [Self::async_policy]。
sourcefn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
Available on crate feature async only.
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
async only.异步从上传凭证内获取上传策略
sourcefn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
生成字符串
该方法的异步版本为 [Self::async_to_token_string]。
sourcefn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
Available on crate feature async only.
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
async only.异步生成字符串
sourceimpl<T: UploadTokenProvider + ?Sized> UploadTokenProvider for Box<T> where
Box<T>: DynClone + Debug + Sync + Send,
impl<T: UploadTokenProvider + ?Sized> UploadTokenProvider for Box<T> where
Box<T>: DynClone + Debug + Sync + Send,
sourcefn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
从上传凭证内获取 AccessKey
该方法的异步版本为 Self::async_access_key。
sourcefn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
Available on crate feature async only.
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
async only.异步从上传凭证内获取 AccessKey
sourcefn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
从上传凭证内获取上传策略
该方法的异步版本为 Self::async_policy。
sourcefn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
Available on crate feature async only.
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
async only.异步从上传凭证内获取上传策略
sourcefn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
生成字符串
该方法的异步版本为 Self::async_to_token_string。
sourcefn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
Available on crate feature async only.
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
async only.异步生成字符串
sourceimpl<T: UploadTokenProvider + ?Sized> UploadTokenProvider for Rc<T> where
Rc<T>: DynClone + Debug + Sync + Send,
impl<T: UploadTokenProvider + ?Sized> UploadTokenProvider for Rc<T> where
Rc<T>: DynClone + Debug + Sync + Send,
sourcefn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
从上传凭证内获取 AccessKey
该方法的异步版本为 Self::async_access_key。
sourcefn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
Available on crate feature async only.
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
async only.异步从上传凭证内获取 AccessKey
sourcefn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
从上传凭证内获取上传策略
该方法的异步版本为 Self::async_policy。
sourcefn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
Available on crate feature async only.
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
async only.异步从上传凭证内获取上传策略
sourcefn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
生成字符串
该方法的异步版本为 Self::async_to_token_string。
sourcefn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
Available on crate feature async only.
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
async only.异步生成字符串
sourceimpl<T: UploadTokenProvider + ?Sized> UploadTokenProvider for Arc<T> where
Arc<T>: DynClone + Debug + Sync + Send,
impl<T: UploadTokenProvider + ?Sized> UploadTokenProvider for Arc<T> where
Arc<T>: DynClone + Debug + Sync + Send,
sourcefn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
fn access_key(&self, opts: GetAccessKeyOptions) -> ParseResult<GotAccessKey>
从上传凭证内获取 AccessKey
该方法的异步版本为 Self::async_access_key。
sourcefn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
Available on crate feature async only.
fn async_access_key(
&self,
opts: GetAccessKeyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotAccessKey>> + Send + '_>>
async only.异步从上传凭证内获取 AccessKey
sourcefn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
fn policy(&self, opts: GetPolicyOptions) -> ParseResult<GotUploadPolicy<'_>>
从上传凭证内获取上传策略
该方法的异步版本为 Self::async_policy。
sourcefn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
Available on crate feature async only.
fn async_policy(
&self,
opts: GetPolicyOptions
) -> Pin<Box<dyn Future<Output = ParseResult<GotUploadPolicy<'_>>> + Send + '_>>
async only.异步从上传凭证内获取上传策略
sourcefn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
fn to_token_string(&self, opts: ToStringOptions) -> IoResult<Cow<'_, str>>
生成字符串
该方法的异步版本为 Self::async_to_token_string。
sourcefn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
Available on crate feature async only.
fn async_to_token_string(
&self,
opts: ToStringOptions
) -> Pin<Box<dyn Future<Output = IoResult<Cow<'_, str>>> + Send + '_>>
async only.异步生成字符串