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