Skip to main content

Crate barycenters

Crate barycenters 

Source
Expand description

barycenters — govern any agent, and see what /admit would have blocked.

Ships in shadow mode by default: it never blocks anything, it only records what the /admit boundary WOULD have refused. Read Client::shadow_report for the artifact you screenshot. Flipping to Mode::Enforce (a refusal becomes an error; an unreachable endpoint fails closed) is a deliberate, human act — authority_effect 0 → 1 — not something this library decides.

Zero dependencies. The HTTP call is injected via the Transport trait, so you wire your own client (reqwest, ureq, or std) behind it and the crate needs no HTTP dependency of its own.

let mut c = Client::new(Config { endpoint: Some("https://…".into()), ..Default::default() }, my_transport);
let d = c.admit("deploy_prod", "{\"env\":\"production\"}")?; // shadow: never errors; d.would_block tells you
println!("{}", c.shadow_report().summary);

Structs§

Client
Config
Client configuration. Use ..Default::default() for anything you don’t set.
Decision
The result of a single Client::admit call.
Resp
A raw HTTP response from the injected transport.
ShadowReport
What /admit would have blocked this session.

Enums§

AdmitError
Returned by admit in Enforce mode.
Mode
Shadow never blocks; Enforce makes a refusal an error.

Traits§

Transport
The one thing you implement: POST a body to a URL with an idempotency key.