Struct salvo_cache::RequestIssuer
source · pub struct RequestIssuer { /* private fields */ }
Expand description
Identify user by Request Uri.
Implementations§
source§impl RequestIssuer
impl RequestIssuer
sourcepub fn use_scheme(self, value: bool) -> Self
pub fn use_scheme(self, value: bool) -> Self
Whether to use request’s uri scheme when generate the key.
Whether to use request’s uri authority when generate the key.
sourcepub fn use_path(self, value: bool) -> Self
pub fn use_path(self, value: bool) -> Self
Whether to use request’s uri path when generate the key.
sourcepub fn use_query(self, value: bool) -> Self
pub fn use_query(self, value: bool) -> Self
Whether to use request’s uri query when generate the key.
sourcepub fn use_method(self, value: bool) -> Self
pub fn use_method(self, value: bool) -> Self
Whether to use request method when generate the key.
Trait Implementations§
source§impl CacheIssuer for RequestIssuer
impl CacheIssuer for RequestIssuer
source§fn issue<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
_depot: &'life2 Depot
) -> Pin<Box<dyn Future<Output = Option<Self::Key>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn issue<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 mut Request,
_depot: &'life2 Depot
) -> Pin<Box<dyn Future<Output = Option<Self::Key>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Issue a new key for the request. If it returns
None
, the request will not be cached.