pub trait AuthorizationProvider:
DynClone
+ Debug
+ Sync
+ Send {
// Required methods
fn sign(
&self,
request: &mut Request<'_, RequestBody<'_>>,
) -> Result<(), AuthorizationError>;
fn async_sign<'a>(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a>>;
}
Expand description
七牛鉴权签名接口
对 HTTP 请求进行签名
Required Methods§
Sourcefn sign(
&self,
request: &mut Request<'_, RequestBody<'_>>,
) -> Result<(), AuthorizationError>
fn sign( &self, request: &mut Request<'_, RequestBody<'_>>, ) -> Result<(), AuthorizationError>
使用指定的鉴权方式对 HTTP 请求进行签名
该方法的异步版本为 Self::async_sign
。
Sourcefn async_sign<'a>(
&'a self,
request: &'a mut Request<'_, AsyncRequestBody<'_>>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a>>
fn async_sign<'a>( &'a self, request: &'a mut Request<'_, AsyncRequestBody<'_>>, ) -> Pin<Box<dyn Future<Output = Result<(), AuthorizationError>> + Send + 'a>>
使用指定的鉴权方式对异步 HTTP 请求进行签名
Trait Implementations§
Source§impl<'clone> Clone for Box<dyn AuthorizationProvider + 'clone>
impl<'clone> Clone for Box<dyn AuthorizationProvider + 'clone>
Source§fn clone(&self) -> Box<dyn AuthorizationProvider + 'clone>
fn clone(&self) -> Box<dyn AuthorizationProvider + 'clone>
Returns a copy 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 more