Expand description
Safe Rust bindings for Varnish, providing everything needed to write pure-Rust VMODs. See also the examples.
For a guide to building a VMOD — project structure, Cargo.toml, VTC tests — see vcl.
To read Varnish statistics from an external program, see MetricsReader.
Modules§
- varnishtest
- vcl
- This module gathers the tools needed to build a vmod in
rust.
Macros§
- report_
details_ json - Creates a JSON string with custom indentation and writes it to a Buffer:
- run_
vtc_ tests - Generate one
#[test]function per VTC file matching the glob pattern.
Structs§
- Metric
- A live statistic
- Metrics
Reader - The VSC (Varnish Shared Counter) is a way for outside programs to access Varnish statistics in a
non-blocking way. The main way to access those counters traditionally is with
varnishstat, but the API is generic and allows you to track, filter and read any counter thatvarnishd(and vmods) are exposing. - Metrics
Reader Builder - Initialize and configure a
MetricsReaderbut do not attach it to a runningvarnishdinstance - Vsc
- Owns a live Varnish statistics (VSC) segment for a
T: VscMetricstruct.
Enums§
- Metric
Format - Unit of a value
- Semantics
- Kind of data
Traits§
- VscMetric
- Trait implemented by structs derived with
#[derive(VscMetric)].
Attribute Macros§
- vmod
- Handle the
#[vmod]attribute. This attribute can only be applied to a module. Inside the module, it handles the following items:
Derive Macros§
- VscMetric
- Handle the
#[derive(VscMetric)]macro. This can only be applied to a struct.