### Rust Documentation Resources Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/cache_control Provides links to essential Rust documentation resources, including the official website, The Book, Standard Library API Reference, Rust by Example, The Cargo Guide, and Clippy Documentation. ```Rust * [Rust website](https://www.rust-lang.org/) * [The Book](https://doc.rust-lang.org/book/) * [Standard Library API Reference](https://doc.rust-lang.org/std/) * [Rust by Example](https://doc.rust-lang.org/rust-by-example/) * [The Cargo Guide](https://doc.rust-lang.org/cargo/guide/) * [Clippy Documentation](https://doc.rust-lang.org/nightly/clippy) ``` -------------------------------- ### Rust Ecosystem Links Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/variance Provides links to essential Rust resources, including the main Rust website, The Book, Standard Library API Reference, Rust by Example, the Cargo Guide, and Clippy documentation. These resources are valuable for learning and using Rust effectively. ```Rust * [Rust website](https://www.rust-lang.org/) * [The Book](https://doc.rust-lang.org/book/) * [Standard Library API Reference](https://doc.rust-lang.org/std/) * [Rust by Example](https://doc.rust-lang.org/rust-by-example/) * [The Cargo Guide](https://doc.rust-lang.org/cargo/guide/) * [Clippy Documentation](https://doc.rust-lang.org/nightly/clippy) ``` -------------------------------- ### Rust Documentation Resources Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/memory Provides links to essential Rust documentation resources, including the official Rust website, The Book, Standard Library API Reference, Rust by Example, The Cargo Guide, and Clippy Documentation. These resources are valuable for learning and using the Rust programming language. ```Rust * [Rust website](https://www.rust-lang.org/) * [The Book](https://doc.rust-lang.org/book/) * [Standard Library API Reference](https://doc.rust-lang.org/std/) * [Rust by Example](https://doc.rust-lang.org/rust-by-example/) * [The Cargo Guide](https://doc.rust-lang.org/cargo/guide/) * [Clippy Documentation](https://doc.rust-lang.org/nightly/clippy) ``` -------------------------------- ### Docs.rs and Rust Resources Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/eviction/mod Provides links to various resources related to Docs.rs and the Rust programming language, including the official website, documentation, and guides. ```Rust * [docs.rs](https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/eviction/mod.rs.html) * [](https://docs.rs/about) * [](https://docs.rs/about/badges) * [](https://docs.rs/about/builds) * [](https://docs.rs/about/metadata) * [](https://docs.rs/about/redirections) * [](https://docs.rs/about/download) * [](https://docs.rs/about/rustdoc-json) * [](https://docs.rs/releases/queue) * [](https://foundation.rust-lang.org/policies/privacy-policy/#docs.rs) * [Rust](https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/eviction/mod.rs.html) * [Rust website](https://www.rust-lang.org/) * [The Book](https://doc.rust-lang.org/book/) * [Standard Library API Reference](https://doc.rust-lang.org/std/) * [Rust by Example](https://doc.rust-lang.org/rust-by-example/) * [The Cargo Guide](https://doc.rust-lang.org/cargo/guide/) * [Clippy Documentation](https://doc.rust-lang.org/nightly/clippy) ``` -------------------------------- ### Check Request Cacheability Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/filters Determines if a given request header indicates a cacheable request. Currently, only GET and HEAD methods are considered cacheable. This function is a starting point and may be expanded to include more criteria. ```rust /// Decide if the request can be cacheable pub fn request_cacheable(req_header: &ReqHeader) -> bool { // TODO: the check is incomplete matches!(req_header.method, Method::GET | Method::HEAD) } ``` -------------------------------- ### Manually Create Box from Scratch with System Allocator (Rust) Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/storage/type Illustrates manually creating a Box from scratch using the system allocator. This involves allocating memory, writing data, and then constructing the Box. Requires `allocator_api` and `slice_ptr_get` features. ```rust #![feature(allocator_api, slice_ptr_get)]\n\nuse std::alloc::{Allocator, Layout, System};\n\nunsafe {\n let ptr = System.allocate(Layout::new::())?.as_mut_ptr() as *mut i32;\n // In general .write is required to avoid attempting to destruct\n // the (uninitialized) previous contents of `ptr`, though for this\n // simple example `*ptr = 5` would have worked as well.\n ptr.write(5);\n let x = Box::from_raw_in(ptr, System);\n} ``` -------------------------------- ### Rust String as_mut_vec() Example Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/cache_control/type Illustrates the use of the unsafe `as_mut_vec` method to get a mutable reference to the underlying byte vector of a String. This allows direct manipulation of bytes but requires careful handling to maintain UTF-8 validity. ```rust let mut s = String::from("hello"); unsafe { let vec = s.as_mut_vec(); assert_eq!(&[104, 101, 108, 108, 111][..], &vec[..]); vec.reverse(); } assert_eq!(s, "olleh"); ``` -------------------------------- ### Rustdoc Help Information Source: https://docs.rs/pingora-cache/0.6.0/help Provides guidance on navigating and understanding Rust documentation generated by rustdoc. It links to the official rustdoc book for more comprehensive details. ```Rust You can find more information in [the rustdoc book](https://doc.rust-lang.org/nightly/rustdoc/). ``` -------------------------------- ### pingora_cache Module Documentation Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type Provides an overview of the pingora_cache module, including its version and links to related documentation and resources. It also lists the crate's dependencies and platform support. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Content: [ Docs.rs ](https://docs.rs/) * [ pingora-cache-0.6.0 ](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type.FreshDurationByStatusFn.html "HTTP caching APIs for Pingora proxy." ) * pingora-cache 0.6.0 * [ ](https://docs.rs/crate/pingora-cache/0.6.0 "See pingora-cache in docs.rs") * [Apache-2.0](https://spdx.org/licenses/Apache-2.0) * Links * [ ](https://github.com/cloudflare/pingora) * [ ](https://crates.io/crates/pingora-cache "See pingora-cache in crates.io") * [ ](https://docs.rs/crate/pingora-cache/0.6.0/source/ "Browse source of pingora-cache-0.6.0") * Owners * [ ](https://crates.io/users/Noah-Kennedy) * [ ](https://crates.io/users/johnhurt) * [ ](https://crates.io/users/eaufavor) * [ ](https://crates.io/users/andrewhavck) * [ ](https://crates.io/users/drcaramelsyrup) * Dependencies * * [ ahash >=0.8.9 _normal_ ](https://docs.rs/ahash/>=0.8.9) * [ async-trait ^0.1.42 _normal_ ](https://docs.rs/async-trait/^0.1.42) * [ blake2 ^0.10 _normal_ ](https://docs.rs/blake2/^0.10) * [ bytes ^1.0 _normal_ ](https://docs.rs/bytes/^1.0) * [ cf-rustracing ^1.0 _normal_ ](https://docs.rs/cf-rustracing/^1.0) * [ cf-rustracing-jaeger ^1.0 _normal_ ](https://docs.rs/cf-rustracing-jaeger/^1.0) * [ hex ^0.4 _normal_ ](https://docs.rs/hex/^0.4) * [ http ^1.0.0 _normal_ ](https://docs.rs/http/^1.0.0) * [ httparse ^1 _normal_ ](https://docs.rs/httparse/^1) * [ httpdate ^1.0.2 _normal_ ](https://docs.rs/httpdate/^1.0.2) * [ indexmap ^1 _normal_ ](https://docs.rs/indexmap/^1) * [ log ^0.4 _normal_ ](https://docs.rs/log/^0.4) * [ lru ^0.14 _normal_ ](https://docs.rs/lru/^0.14) * [ once_cell ^1 _normal_ ](https://docs.rs/once_cell/^1) * [ parking_lot ^0.12 _normal_ ](https://docs.rs/parking_lot/^0.12) * [ pingora-core ^0.6.0 _normal_ ](https://docs.rs/pingora-core/^0.6.0) * [ pingora-error ^0.6.0 _normal_ ](https://docs.rs/pingora-error/^0.6.0) * [ pingora-header-serde ^0.6.0 _normal_ ](https://docs.rs/pingora-header-serde/^0.6.0) * [ pingora-http ^0.6.0 _normal_ ](https://docs.rs/pingora-http/^0.6.0) * [ pingora-lru ^0.6.0 _normal_ ](https://docs.rs/pingora-lru/^0.6.0) * [ pingora-timeout ^0.6.0 _normal_ ](https://docs.rs/pingora-timeout/^0.6.0) * [ rand ^0.8 _normal_ ](https://docs.rs/rand/^0.8) * [ regex ^1 _normal_ ](https://docs.rs/regex/^1) * [ rmp ^0.8 _normal_ ](https://docs.rs/rmp/^0.8) * [ rmp-serde ^1 _normal_ ](https://docs.rs/rmp-serde/^1) * [ serde ^1.0 _normal_ ](https://docs.rs/serde/^1.0) * [ strum ^0.26 _normal_ ](https://docs.rs/strum/^0.26) * [ tokio ^1 _normal_ ](https://docs.rs/tokio/^1) * [ dhat ^0 _dev_ ](https://docs.rs/dhat/^0) * [ env_logger ^0.9 _dev_ ](https://docs.rs/env_logger/^0.9) * [ futures ^0.3 _dev_ ](https://docs.rs/futures/^0.3) * [ tokio ^1 _dev_ ](https://docs.rs/tokio/^1) * [ tokio-test ^0.4 _dev_ ](https://docs.rs/tokio-test/^0.4) * Versions * [ **85.27%** of the crate is documented ](https://docs.rs/crate/pingora-cache/0.6.0) * [ Platform ](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type.FreshDurationByStatusFn.html) * [i686-unknown-linux-gnu](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type.FreshDurationByStatusFn.html) * [x86_64-unknown-linux-gnu](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type.FreshDurationByStatusFn.html) * [ Feature flags ](https://docs.rs/pingora-cache/0.6.0/pingora_cache/features "Browse available feature flags of pingora-cache-0.6.0") * [docs.rs](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type.FreshDurationByStatusFn.html) * [](https://docs.rs/about) * [](https://docs.rs/about/badges) * [](https://docs.rs/about/builds) * [](https://docs.rs/about/metadata) * [](https://docs.rs/about/redirections) * [](https://docs.rs/about/download) * [](https://docs.rs/about/rustdoc-json) * [](https://docs.rs/releases/queue) * [](https://foundation.rust-lang.org/policies/privacy-policy/#docs.rs) * [Rust](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/type.FreshDurationByStatusFn.html) * [Rust website](https://www.rust-lang.org/) * [The Book](https://doc.rust-lang.org/book/) * [Standard Library API Reference](https://doc.rust-lang.org/std/) * [Rust by Example](https://doc.rust-lang.org/rust-by-example/) * [The Cargo Guide](https://doc.rust-lang.org/cargo/guide/) * [Clippy Documentation](https://doc.rust-lang.org/nightly/clippy) ## [pingora_cache](https://docs.rs/pingora-cache/0.6.0/pingora_cache/index.html)0.6.0 ## [In pingora_cache::meta](https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/index.html) ``` -------------------------------- ### Try Get u8 Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/storage/type Attempts to get an unsigned 8-bit integer from the buffer. Returns a Result indicating success or a TryGetError if the operation fails. ```rust fn try_get_u8(&mut self) -> Result ``` -------------------------------- ### Pingora Cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/eviction/simple_lru Provides an overview of the pingora-cache crate, including its version, license, source code links, and dependencies. It also indicates the percentage of documented code. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: ahash >=0.8.9 async-trait ^0.1.42 blake2 ^0.10 bytes ^1.0 cf-rustracing ^1.0 cf-rustracing-jaeger ^1.0 hex ^0.4 http ^1.0.0 httparse ^1 httpdate ^1.0.2 indexmap ^1 log ^0.4 lru ^0.14 once_cell ^1 parking_lot ^0.12 pingora-core ^0.6.0 pingora-error ^0.6.0 pingora-header-serde ^0.6.0 pingora-http ^0.6.0 pingora-lru ^0.6.0 pingora-timeout ^0.6.0 rand ^0.8 regex ^1 rmp ^0.8 rmp-serde ^1 serde ^1.0 strum ^0.26 tokio ^1 Dev Dependencies: dhat ^0 env_logger ^0.9 futures ^0.3 tokio ^1 tokio-test ^0.4 Documentation Coverage: 85.27% License: Apache-2.0 ``` -------------------------------- ### Try Get i8 Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/storage/type Attempts to get a signed 8-bit integer from the buffer. Returns a Result indicating success or a TryGetError if the operation fails. ```rust fn try_get_i8(&mut self) -> Result ``` -------------------------------- ### Rust String is_empty() Example Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/cache_control/type Provides an example of the `is_empty` method, which checks if a String has a length of zero. It shows its usage with both an empty and a non-empty string. ```rust let mut v = String::new(); assert!(v.is_empty()); v.push('a'); assert!(!v.is_empty()); ``` -------------------------------- ### pingora-cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/key/type Provides an overview of the pingora-cache crate, including its version, license, dependencies, and documentation status. It also lists supported platforms and feature flags. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: ahash >=0.8.9 async-trait ^0.1.42 blake2 ^0.10 bytes ^1.0 cf-rustracing ^1.0 cf-rustracing-jaeger ^1.0 hex ^0.4 http ^1.0.0 httparse ^1 httpdate ^1.0.2 indexmap ^1 log ^0.4 lru ^0.14 once_cell ^1 parking_lot ^0.12 pingora-core ^0.6.0 pingora-error ^0.6.0 pingora-header-serde ^0.6.0 pingora-http ^0.6.0 pingora-lru ^0.6.0 pingora-timeout ^0.6.0 rand ^0.8 regex ^1 rmp ^0.8 rmp-serde ^1 serde ^1.0 strum ^0.26 tokio ^1 Dev Dependencies: dhat ^0 env_logger ^0.9 futures ^0.3 tokio ^1 tokio-test ^0.4 Platforms: i686-unknown-linux-gnu x86_64-unknown-linux-gnu Documentation Status: 85.27% ``` -------------------------------- ### Pingora Cache Settings Source: https://docs.rs/pingora-cache/0.6.0/settings This section details the configuration settings for the pingora-cache crate. It outlines the various parameters and options available for customizing HTTP caching behavior within the Pingora proxy. No specific code examples are provided in this snippet, but it serves as a reference for configuration. ```Rust ## Settings This section details the configuration settings for the pingora-cache crate. It outlines the various parameters and options available for customizing HTTP caching behavior within the Pingora proxy. No specific code examples are provided in this snippet, but it serves as a reference for configuration. ``` -------------------------------- ### Get Length of Extensions in Pingora Cache Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/struct Demonstrates how to get the number of extensions currently stored in the Extensions struct. This can be used to track the quantity of associated data. ```rust let mut ext = Extensions::new(); assert_eq!(ext.len(), 0); ext.insert(5i32); assert_eq!(ext.len(), 1); ``` -------------------------------- ### Try Get u16 Little-Endian Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/storage/type Attempts to get an unsigned 16-bit integer from the buffer in little-endian byte order. Returns a Result indicating success or a TryGetError if the operation fails. ```rust fn try_get_u16_le(&mut self) -> Result ``` -------------------------------- ### Create Simple LRU Cache Manager Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/eviction/simple_lru/struct Creates a new Manager for the Simple LRU eviction strategy with a specified total size limit. This is the entry point for initializing the cache's eviction mechanism. ```rust pub fn new(limit: usize) -> Self ``` -------------------------------- ### Rust Box Creation Example Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/storage/type Demonstrates the creation of a boxed value in Rust and asserts its equality with a boxed version of a primitive type. This showcases basic memory management and type conversion. ```rust let x = 5; let boxed = Box::new(5); assert_eq!(Box::from(x), boxed); ``` -------------------------------- ### Rust String::from_utf8 Invalid Bytes Example Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/cache_control/type Shows how `String::from_utf8` handles invalid UTF-8 byte sequences, returning an error. This example checks if the conversion results in an error. ```rust // some invalid bytes, in a vector let sparkle_heart = vec![0, 159, 146, 150]; assert!(String::from_utf8(sparkle_heart).is_err()); ``` -------------------------------- ### Pingora Cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/all Overview of the pingora-cache crate, its version, license, and links to source code and related projects. It also lists the crate's dependencies. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: * [ ahash >=0.8.9 _normal_ ] * [ async-trait ^0.1.42 _normal_ ] * [ blake2 ^0.10 _normal_ ] * [ bytes ^1.0 _normal_ ] * [ cf-rustracing ^1.0 _normal_ ] * [ cf-rustracing-jaeger ^1.0 _normal_ ] * [ hex ^0.4 _normal_ ] * [ http ^1.0.0 _normal_ ] * [ httparse ^1 _normal_ ] * [ httpdate ^1.0.2 _normal_ ] * [ indexmap ^1 _normal_ ] * [ log ^0.4 _normal_ ] * [ lru ^0.14 _normal_ ] * [ once_cell ^1 _normal_ ] * [ parking_lot ^0.12 _normal_ ] * [ pingora-core ^0.6.0 _normal_ ] * [ pingora-error ^0.6.0 _normal_ ] * [ pingora-header-serde ^0.6.0 _normal_ ] * [ pingora-http ^0.6.0 _normal_ ] * [ pingora-lru ^0.6.0 _normal_ ] * [ pingora-timeout ^0.6.0 _normal_ ] * [ rand ^0.8 _normal_ ] * [ regex ^1 _normal_ ] * [ rmp ^0.8 _normal_ ] * [ rmp-serde ^1 _normal_ ] * [ serde ^1.0 _normal_ ] * [ strum ^0.26 _normal_ ] * [ tokio ^1 _normal_ ] * [ dhat ^0 _dev_ ] * [ env_logger ^0.9 _dev_ ] * [ futures ^0.3 _dev_ ] * [ tokio ^1 _dev_ ] * [ tokio-test ^0.4 _dev_ ] License: Apache-2.0 Platforms: * i686-unknown-linux-gnu * x86_64-unknown-linux-gnu ``` -------------------------------- ### Get CacheKey Namespace Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/key Retrieves the namespace of the CacheKey as a byte slice. ```rust pub fn namespace(&self) -> &[u8] { &self.namespace[..] } ``` -------------------------------- ### Get CacheKey Primary Key Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/key Retrieves the primary key of the CacheKey as a byte slice. ```rust pub fn primary_key(&self) -> &[u8] { &self.primary[..] } ``` -------------------------------- ### Pingora Cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Provides an overview of the pingora-cache crate, including its version, license, source code links, and dependencies. It also indicates the percentage of documented code. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: * [ ahash >=0.8.9 _normal_ ] * [ async-trait ^0.1.42 _normal_ ] * [ blake2 ^0.10 _normal_ ] * [ bytes ^1.0 _normal_ ] * [ cf-rustracing ^1.0 _normal_ ] * [ cf-rustracing-jaeger ^1.0 _normal_ ] * [ hex ^0.4 _normal_ ] * [ http ^1.0.0 _normal_ ] * [ httparse ^1 _normal_ ] * [ httpdate ^1.0.2 _normal_ ] * [ indexmap ^1 _normal_ ] * [ log ^0.4 _normal_ ] * [ lru ^0.14 _normal_ ] * [ once_cell ^1 _normal_ ] * [ parking_lot ^0.12 _normal_ ] * [ pingora-core ^0.6.0 _normal_ ] * [ pingora-error ^0.6.0 _normal_ ] * [ pingora-header-serde ^0.6.0 _normal_ ] * [ pingora-http ^0.6.0 _normal_ ] * [ pingora-lru ^0.6.0 _normal_ ] * [ pingora-timeout ^0.6.0 _normal_ ] * [ rand ^0.8 _normal_ ] * [ regex ^1 _normal_ ] * [ rmp ^0.8 _normal_ ] * [ rmp-serde ^1 _normal_ ] * [ serde ^1.0 _normal_ ] * [ strum ^0.26 _normal_ ] * [ tokio ^1 _normal_ ] Dev Dependencies: * [ dhat ^0 _dev_ ] * [ env_logger ^0.9 _dev_ ] * [ futures ^0.3 _dev_ ] * [ tokio ^1 _dev_ ] * [ tokio-test ^0.4 _dev_ ] Documentation Status: 85.27% of the crate is documented. ``` -------------------------------- ### pingora-cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/meta/struct Provides an overview of the pingora-cache crate, including its version, license, dependencies, and documentation status. It also lists supported platforms and feature flags. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: ahash >=0.8.9 async-trait ^0.1.42 blake2 ^0.10 bytes ^1.0 cf-rustracing ^1.0 cf-rustracing-jaeger ^1.0 hex ^0.4 http ^1.0.0 httparse ^1 httpdate ^1.0.2 indexmap ^1 log ^0.4 lru ^0.14 once_cell ^1 parking_lot ^0.12 pingora-core ^0.6.0 pingora-error ^0.6.0 pingora-header-serde ^0.6.0 pingora-http ^0.6.0 pingora-lru ^0.6.0 pingora-timeout ^0.6.0 rand ^0.8 regex ^1 rmp ^0.8 rmp-serde ^1 serde ^1.0 strum ^0.26 tokio ^1 Dev Dependencies: dhat ^0 env_logger ^0.9 futures ^0.3 tokio ^1 tokio-test ^0.4 Documentation: 85.27% documented Platforms: i686-unknown-linux-gnu, x86_64-unknown-linux-gnu License: Apache-2.0 ``` -------------------------------- ### Get Mutable Response Header Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Provides mutable access to the `ResponseHeader` of an asset, allowing for modifications to the headers. ```rust pub fn response_header_mut(&mut self) -> &mut ResponseHeader { &mut self.0.header } ``` -------------------------------- ### Pingora Cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/eviction/lru Provides an overview of the pingora-cache crate, including its version, license, source code links, and dependencies. It also indicates the percentage of documented code. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: * [ ahash >=0.8.9 _normal_ ] * [ async-trait ^0.1.42 _normal_ ] * [ blake2 ^0.10 _normal_ ] * [ bytes ^1.0 _normal_ ] * [ cf-rustracing ^1.0 _normal_ ] * [ cf-rustracing-jaeger ^1.0 _normal_ ] * [ hex ^0.4 _normal_ ] * [ http ^1.0.0 _normal_ ] * [ httparse ^1 _normal_ ] * [ httpdate ^1.0.2 _normal_ ] * [ indexmap ^1 _normal_ ] * [ log ^0.4 _normal_ ] * [ lru ^0.14 _normal_ ] * [ once_cell ^1 _normal_ ] * [ parking_lot ^0.12 _normal_ ] * [ pingora-core ^0.6.0 _normal_ ] * [ pingora-error ^0.6.0 _normal_ ] * [ pingora-header-serde ^0.6.0 _normal_ ] * [ pingora-http ^0.6.0 _normal_ ] * [ pingora-lru ^0.6.0 _normal_ ] * [ pingora-timeout ^0.6.0 _normal_ ] * [ rand ^0.8 _normal_ ] * [ regex ^1 _normal_ ] * [ rmp ^0.8 _normal_ ] * [ rmp-serde ^1 _normal_ ] * [ serde ^1.0 _normal_ ] * [ strum ^0.26 _normal_ ] * [ tokio ^1 _normal_ ] * [ dhat ^0 _dev_ ] * [ env_logger ^0.9 _dev_ ] * [ futures ^0.3 _dev_ ] * [ tokio ^1 _dev_ ] * [ tokio-test ^0.4 _dev_ ] Documentation Coverage: 85.27% ``` -------------------------------- ### Get HttpCache Phase Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/lib Returns the current CachePhase of the HTTP cache. This indicates the cache's operational state. ```rust pub fn phase(&self) -> CachePhase { self.phase } ``` -------------------------------- ### pingora-cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/max_file_size/constant Overview of the pingora-cache crate, including its purpose, version, license, and links to related resources like the source code, crates.io, and owners. ```Rust Project: /websites/rs_pingora-cache_0_6_0 [pingora-cache](https://docs.rs/pingora-cache/0.6.0/pingora_cache/index.html) 0.6.0 HTTP caching APIs for Pingora proxy. License: Apache-2.0 Source: https://github.com/cloudflare/pingora Crates.io: https://crates.io/crates/pingora-cache Dependencies: - ahash >=0.8.9 - async-trait ^0.1.42 - blake2 ^0.10 - bytes ^1.0 - cf-rustracing ^1.0 - cf-rustracing-jaeger ^1.0 - hex ^0.4 - http ^1.0.0 - httparse ^1 - httpdate ^1.0.2 - indexmap ^1 - log ^0.4 - lru ^0.14 - once_cell ^1 - parking_lot ^0.12 - pingora-core ^0.6.0 - pingora-error ^0.6.0 - pingora-header-serde ^0.6.0 - pingora-http ^0.6.0 - pingora-lru ^0.6.0 - pingora-timeout ^0.6.0 - rand ^0.8 - regex ^1 - rmp ^0.8 - rmp-serde ^1 - serde ^1.0 - strum ^0.26 - tokio ^1 Dev Dependencies: - dhat ^0 - env_logger ^0.9 - futures ^0.3 - tokio ^1 - tokio-test ^0.4 Documentation: 85.27% documented. Platform Support: - i686-unknown-linux-gnu - x86_64-unknown-linux-gnu Feature Flags: Available feature flags can be browsed at https://docs.rs/crate/pingora-cache/0.6.0/features ``` -------------------------------- ### Get Copy of Response Header Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Returns a clone of the `ResponseHeader` of an asset. This is useful when a separate copy of the header is needed. ```rust pub fn response_header_copy(&self) -> ResponseHeader { self.0.header.clone() } ``` -------------------------------- ### Create Zeroed Box with System Allocator Source: https://docs.rs/pingora-cache/0.6.0/pingora_cache/storage/type Demonstrates creating a new, zero-initialized Box with a specified allocator. This example utilizes the `allocator_api` feature and the `System` allocator to create a `Box` initialized to zero. It requires unsafe code to assume initialization. ```rust #![feature(allocator_api)] use std::alloc::System; let zero = Box::::try_new_zeroed_in(System)?; let zero = unsafe { zero.assume_init() }; assert_eq!(*zero, 0); ``` -------------------------------- ### Get Response Header Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Provides read-only access to the `ResponseHeader` of an asset. This is useful for inspecting the headers without modifying them. ```rust pub fn response_header(&self) -> &ResponseHeader { &self.0.header } ``` -------------------------------- ### Get Asset Extensions Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Returns a reference to the `Extensions` associated with an asset, allowing for read-only access to extended metadata. ```rust pub fn extensions(&self) -> &Extensions { &self.0.extensions } ``` -------------------------------- ### pingora_cache Modules Overview Source: https://docs.rs/pingora-cache/0.6.0/index An overview of the modules available within the pingora_cache crate, detailing their respective functionalities. ```rust mod cache_control; mod eviction; mod filters; mod hashtable; mod key; mod lock; mod max_file_size; mod meta; mod predictor; mod prelude; mod put; mod storage; mod trace; ``` -------------------------------- ### Pingora Cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/lib Provides an overview of the pingora-cache crate, including its purpose as an HTTP caching solution for the Pingora proxy. It lists associated licenses, source code links, and dependency information. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Dependencies: * ahash >=0.8.9 * async-trait ^0.1.42 * blake2 ^0.10 * bytes ^1.0 * cf-rustracing ^1.0 * cf-rustracing-jaeger ^1.0 * hex ^0.4 * http ^1.0.0 * httparse ^1 * httpdate ^1.0.2 * indexmap ^1 * log ^0.4 * lru ^0.14 * once_cell ^1 * parking_lot ^0.12 * pingora-core ^0.6.0 * pingora-error ^0.6.0 * pingora-header-serde ^0.6.0 * pingora-http ^0.6.0 * pingora-lru ^0.6.0 * pingora-timeout ^0.6.0 * rand ^0.8 * regex ^1 * rmp ^0.8 * rmp-serde ^1 * serde ^1.0 * strum ^0.26 * tokio ^1 Dev Dependencies: * dhat ^0 * env_logger ^0.9 * futures ^0.3 * tokio ^1 * tokio-test ^0.4 License: Apache-2.0 Source: https://github.com/cloudflare/pingora ``` -------------------------------- ### Get Mutable Asset Extensions Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Returns a mutable reference to the `Extensions` associated with an asset, enabling modification of extended metadata. ```rust pub fn extensions_mut(&mut self) -> &mut Extensions { &mut self.0.extensions } ``` -------------------------------- ### Get Variance Hash Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/meta Retrieves the variance hash of an asset. This hash is used to identify variations or specific versions of an asset. ```rust /// Get the variance hash of this asset pub fn variance(&self) -> Option { ``` -------------------------------- ### Pingora Cache Keyboard Shortcuts Source: https://docs.rs/pingora-cache/0.6.0/help Provides a list of keyboard shortcuts for interacting with the Pingora cache interface, including help, search, navigation, and section expansion/collapse. ```APIDOC Keyboard Shortcuts: `?`: Show help dialog `S` / `/`: Focus search field `↑`: Move up in search results `↓`: Move down in search results `←` / `→`: Switch result tab (when results focused) `⏎`: Go to active search result `+`: Expand all sections `-`: Collapse all sections `_`: Collapse all sections, including impl blocks ``` -------------------------------- ### Pingora Cache Crate Overview Source: https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/cache_control Provides an overview of the pingora-cache crate, including its version, license, source code links, and dependencies. It also indicates the percentage of documented code. ```Rust Project: /websites/rs_pingora-cache_0_6_0 Content: [ Docs.rs ](https://docs.rs/) * [ pingora-cache-0.6.0 ](https://docs.rs/pingora-cache/0.6.0/src/pingora_cache/cache_control.rs.html "HTTP caching APIs for Pingora proxy." ) * pingora-cache 0.6.0 * [ ](https://docs.rs/crate/pingora-cache/0.6.0 "See pingora-cache in docs.rs") * [Apache-2.0](https://spdx.org/licenses/Apache-2.0) * Links * [ ](https://github.com/cloudflare/pingora) * [ ](https://crates.io/crates/pingora-cache "See pingora-cache in crates.io") * [ ](https://docs.rs/crate/pingora-cache/0.6.0/source/ "Browse source of pingora-cache-0.6.0") * Owners * [ ](https://crates.io/users/Noah-Kennedy) * [ ](https://crates.io/users/johnhurt) * [ ](https://crates.io/users/eaufavor) * [ ](https://crates.io/users/andrewhavck) * [ ](https://crates.io/users/drcaramelsyrup) * Dependencies * * [ ahash >=0.8.9 _normal_ ](https://docs.rs/ahash/>=0.8.9) * [ async-trait ^0.1.42 _normal_ ](https://docs.rs/async-trait/^0.1.42) * [ blake2 ^0.10 _normal_ ](https://docs.rs/blake2/^0.10) * [ bytes ^1.0 _normal_ ](https://docs.rs/bytes/^1.0) * [ cf-rustracing ^1.0 _normal_ ](https://docs.rs/cf-rustracing/^1.0) * [ cf-rustracing-jaeger ^1.0 _normal_ ](https://docs.rs/cf-rustracing-jaeger/^1.0) * [ hex ^0.4 _normal_ ](https://docs.rs/hex/^0.4) * [ http ^1.0.0 _normal_ ](https://docs.rs/http/^1.0.0) * [ httparse ^1 _normal_ ](https://docs.rs/httparse/^1) * [ httpdate ^1.0.2 _normal_ ](https://docs.rs/httpdate/^1.0.2) * [ indexmap ^1 _normal_ ](https://docs.rs/indexmap/^1) * [ log ^0.4 _normal_ ](https://docs.rs/log/^0.4) * [ lru ^0.14 _normal_ ](https://docs.rs/lru/^0.14) * [ once_cell ^1 _normal_ ](https://docs.rs/once_cell/^1) * [ parking_lot ^0.12 _normal_ ](https://docs.rs/parking_lot/^0.12) * [ pingora-core ^0.6.0 _normal_ ](https://docs.rs/pingora-core/^0.6.0) * [ pingora-error ^0.6.0 _normal_ ](https://docs.rs/pingora-error/^0.6.0) * [ pingora-header-serde ^0.6.0 _normal_ ](https://docs.rs/pingora-header-serde/^0.6.0) * [ pingora-http ^0.6.0 _normal_ ](https://docs.rs/pingora-http/^0.6.0) * [ pingora-lru ^0.6.0 _normal_ ](https://docs.rs/pingora-lru/^0.6.0) * [ pingora-timeout ^0.6.0 _normal_ ](https://docs.rs/pingora-timeout/^0.6.0) * [ rand ^0.8 _normal_ ](https://docs.rs/rand/^0.8) * [ regex ^1 _normal_ ](https://docs.rs/regex/^1) * [ rmp ^0.8 _normal_ ](https://docs.rs/rmp/^0.8) * [ rmp-serde ^1 _normal_ ](https://docs.rs/rmp-serde/^1) * [ serde ^1.0 _normal_ ](https://docs.rs/serde/^1.0) * [ strum ^0.26 _normal_ ](https://docs.rs/strum/^0.26) * [ tokio ^1 _normal_ ](https://docs.rs/tokio/^1) * [ dhat ^0 _dev_ ](https://docs.rs/dhat/^0) * [ env_logger ^0.9 _dev_ ](https://docs.rs/env_logger/^0.9) * [ futures ^0.3 _dev_ ](https://docs.rs/futures/^0.3) * [ tokio ^1 _dev_ ](https://docs.rs/tokio/^1) * [ tokio-test ^0.4 _dev_ ](https://docs.rs/tokio-test/^0.4) * Versions * [ **85.27%** of the crate is documented ](https://docs.rs/crate/pingora-cache/0.6.0) ```