pub struct DefaultKeyer;Expand description
Default keyer that uses HTTP method and path.
Generates keys in the format: {METHOD} {path}
§Example
let keyer = DefaultKeyer;
let req = Request::get("/users/123").body(()).unwrap();
let key = keyer.cache_key(&req);
assert_eq!(key, "GET /users/123");Trait Implementations§
Source§impl Clone for DefaultKeyer
impl Clone for DefaultKeyer
Source§fn clone(&self) -> DefaultKeyer
fn clone(&self) -> DefaultKeyer
Returns a duplicate 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 moreSource§impl Debug for DefaultKeyer
impl Debug for DefaultKeyer
Source§impl Default for DefaultKeyer
impl Default for DefaultKeyer
Source§fn default() -> DefaultKeyer
fn default() -> DefaultKeyer
Returns the “default value” for a type. Read more
Source§impl Keyer for DefaultKeyer
impl Keyer for DefaultKeyer
impl Copy for DefaultKeyer
Auto Trait Implementations§
impl Freeze for DefaultKeyer
impl RefUnwindSafe for DefaultKeyer
impl Send for DefaultKeyer
impl Sync for DefaultKeyer
impl Unpin for DefaultKeyer
impl UnwindSafe for DefaultKeyer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more