Function fastly::cache::simple::get

source ·
pub fn get(key: impl Into<CacheKey>) -> Result<Option<Body>, CacheError>
Expand description

Get the entry associated with the given cache key, if it exists.

if let Some(value) = get("my_key").unwrap() {
    let cached_string = value.into_string();
    println!("the cached string was: {cached_string}");
}

§Argument type conversion

See the From impls for Bytes to see which types can be used as a key.