pub struct CacheKey {
pub api_name: String,
pub operation_id: String,
pub request_hash: String,
}Expand description
Cache key components for generating cache file names
Fields§
§api_name: StringAPI specification name
operation_id: StringOperation ID from OpenAPI spec
request_hash: StringHash of request parameters and body
Implementations§
Source§impl CacheKey
impl CacheKey
Sourcepub fn from_request(
api_name: &str,
operation_id: &str,
method: &str,
url: &str,
headers: &HashMap<String, String>,
body: Option<&str>,
) -> Result<Self, Error>
pub fn from_request( api_name: &str, operation_id: &str, method: &str, url: &str, headers: &HashMap<String, String>, body: Option<&str>, ) -> Result<Self, Error>
Generate a cache key from request information
§Errors
Returns an error if hashing fails (should be rare)
Sourcepub fn to_filename(&self) -> String
pub fn to_filename(&self) -> String
Generate the cache file name for this key
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CacheKey
impl RefUnwindSafe for CacheKey
impl Send for CacheKey
impl Sync for CacheKey
impl Unpin for CacheKey
impl UnwindSafe for CacheKey
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