Skip to main content

Module predicate

Module predicate 

Source
Expand description

Caching decision predicates.

This module provides the Predicate trait and PredicateResult enum for determining whether requests and responses should be cached.

§Overview

Predicates are the core mechanism for controlling cache behavior. They evaluate a subject (request or response) and return whether it should be cached or passed through without caching.

§Composability

Predicates are designed to be composed using logical combinators:

  • Not - Inverts a predicate result
  • Or - Either predicate returning Cacheable is sufficient

Chaining predicates sequentially provides AND semantics by default.

Re-exports§

pub use combinators::And;
pub use combinators::Not;
pub use combinators::Or;
pub use combinators::PredicateExt;
pub use neutral::Neutral;

Modules§

combinators
Logical combinators for composing predicates.
neutral
Neutral predicate that always returns Cacheable.

Enums§

PredicateResult
Result of a predicate evaluation.

Traits§

Predicate
Trait for evaluating whether a subject should be cached.