pub trait SimplifiedCallbackContext: Sync + Send + Debug {
    // Required methods
    fn use_https(&self) -> bool;
    fn method(&self) -> &Method;
    fn version(&self) -> Version;
    fn path(&self) -> &str;
    fn query(&self) -> &str;
    fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)];
    fn headers(&self) -> &HeaderMap<HeaderValue>;
    fn appended_user_agent(&self) -> &UserAgent;
    fn authorization(&self) -> Option<&Authorization<'_>>;
    fn idempotent(&self) -> Idempotent;
}
Expand description

简化回调函数上下文

用于在回调函数中获取请求相关信息,如请求路径、请求方法、查询参数、请求头等。

Required Methods§

fn use_https(&self) -> bool

是否使用 HTTPS 协议

fn method(&self) -> &Method

获取请求 HTTP 方法

fn version(&self) -> Version

获取请求 HTTP 版本

fn path(&self) -> &str

获取请求路径

fn query(&self) -> &str

获取请求查询参数

fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)]

获取请求查询对

fn headers(&self) -> &HeaderMap<HeaderValue>

获取请求 HTTP Headers

fn appended_user_agent(&self) -> &UserAgent

获取追加的 UserAgent

fn authorization(&self) -> Option<&Authorization<'_>>

获取七牛鉴权签名

fn idempotent(&self) -> Idempotent

获取请求幂等性

Implementations on Foreign Types§

§

impl<T> SimplifiedCallbackContext for Box<T, Global>where T: SimplifiedCallbackContext + ?Sized, Box<T, Global>: Sync + Send + Debug,

§

fn use_https(&self) -> bool

§

fn method(&self) -> &Method

§

fn version(&self) -> Version

§

fn path(&self) -> &str

§

fn query(&self) -> &str

§

fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)]

§

fn headers(&self) -> &HeaderMap<HeaderValue>

§

fn appended_user_agent(&self) -> &UserAgent

§

fn authorization(&self) -> Option<&Authorization<'_>>

§

fn idempotent(&self) -> Idempotent

§

impl<T> SimplifiedCallbackContext for Rc<T>where T: SimplifiedCallbackContext + ?Sized, Rc<T>: Sync + Send + Debug,

§

fn use_https(&self) -> bool

§

fn method(&self) -> &Method

§

fn version(&self) -> Version

§

fn path(&self) -> &str

§

fn query(&self) -> &str

§

fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)]

§

fn headers(&self) -> &HeaderMap<HeaderValue>

§

fn appended_user_agent(&self) -> &UserAgent

§

fn authorization(&self) -> Option<&Authorization<'_>>

§

fn idempotent(&self) -> Idempotent

§

impl<T> SimplifiedCallbackContext for Arc<T>where T: SimplifiedCallbackContext + ?Sized, Arc<T>: Sync + Send + Debug,

§

fn use_https(&self) -> bool

§

fn method(&self) -> &Method

§

fn version(&self) -> Version

§

fn path(&self) -> &str

§

fn query(&self) -> &str

§

fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)]

§

fn headers(&self) -> &HeaderMap<HeaderValue>

§

fn appended_user_agent(&self) -> &UserAgent

§

fn authorization(&self) -> Option<&Authorization<'_>>

§

fn idempotent(&self) -> Idempotent

§

impl<'a, T> SimplifiedCallbackContext for &'a Twhere T: 'a + SimplifiedCallbackContext + ?Sized, &'a T: Sync + Send + Debug,

§

fn use_https(&self) -> bool

§

fn method(&self) -> &Method

§

fn version(&self) -> Version

§

fn path(&self) -> &str

§

fn query(&self) -> &str

§

fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)]

§

fn headers(&self) -> &HeaderMap<HeaderValue>

§

fn appended_user_agent(&self) -> &UserAgent

§

fn authorization(&self) -> Option<&Authorization<'_>>

§

fn idempotent(&self) -> Idempotent

§

impl<'a, T> SimplifiedCallbackContext for &'a mut Twhere T: 'a + SimplifiedCallbackContext + ?Sized, &'a mut T: Sync + Send + Debug,

§

fn use_https(&self) -> bool

§

fn method(&self) -> &Method

§

fn version(&self) -> Version

§

fn path(&self) -> &str

§

fn query(&self) -> &str

§

fn query_pairs(&self) -> &[(Cow<'_, str>, Cow<'_, str>)]

§

fn headers(&self) -> &HeaderMap<HeaderValue>

§

fn appended_user_agent(&self) -> &UserAgent

§

fn authorization(&self) -> Option<&Authorization<'_>>

§

fn idempotent(&self) -> Idempotent

Implementors§

§

impl SimplifiedCallbackContext for RequestParts<'_>