pub struct StoredCache {
pub policy: StoredCachePolicy,
pub compression: Option<CompressionAlgorithms>,
pub internal_compression: Option<ArrayVec<CompressionAlgorithm, 4>>,
pub max_ttl: Option<u64>,
pub hit_ttl: Option<u64>,
pub max_size: Option<u64>,
pub max_count: Option<usize>,
pub frequency_window: Option<u64>,
pub clean_interval: Option<(u64, u64)>,
pub evict_on_dependency_change: Option<bool>,
}Expand description
Render caching policy.
IMPORTANT: Very experimental, may not work as described. policy: Permanent is currently
the most likely to behave correctly.
Fields§
§policy: StoredCachePolicy§compression: Option<CompressionAlgorithms>Which compression formats should be stored
internal_compression: Option<ArrayVec<CompressionAlgorithm, 4>>§max_ttl: Option<u64>Upper limit on total time a cached item can be stored
Unit: seconds
hit_ttl: Option<u64>Compared with time since last hit.
Unit: seconds
max_size: Option<u64>Upper limit on the cumulative size of all cached responses for a given template.
Unit: bytes
max_count: Option<usize>Upper limit on the number of cached responses stored at a given time, for a given template.
frequency_window: Option<u64>How long an LFU “hit” tick is valid for
Unit: seconds
clean_interval: Option<(u64, u64)>Rate at which the cache is cleaned based on other rules.
Option<(min, max)>
evict_on_dependency_change: Option<bool>Whether a cached item should also track the of models and content which it depends on, and evict when they are modified.
Trait Implementations§
Source§impl Clone for StoredCache
impl Clone for StoredCache
Source§fn clone(&self) -> StoredCache
fn clone(&self) -> StoredCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for StoredCache
impl ComposeSchema for StoredCache
Source§impl Debug for StoredCache
impl Debug for StoredCache
Source§impl<'de> Deserialize<'de> for StoredCache
impl<'de> Deserialize<'de> for StoredCache
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for StoredCache
impl JsonSchema for StoredCache
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for StoredCache
impl Serialize for StoredCache
Auto Trait Implementations§
impl Freeze for StoredCache
impl RefUnwindSafe for StoredCache
impl Send for StoredCache
impl Sync for StoredCache
impl Unpin for StoredCache
impl UnsafeUnpin for StoredCache
impl UnwindSafe for StoredCache
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