Skip to main content

Crate varnish

Crate varnish 

Source
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
MetricsReader
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 that varnishd (and vmods) are exposing.
MetricsReaderBuilder
Initialize and configure a MetricsReader but do not attach it to a running varnishd instance
Vsc
Owns a live Varnish statistics (VSC) segment for a T: VscMetric struct.

Enums§

MetricFormat
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.