soothfast v0.1.0

soothfast-registry API reference#

Generated by cargo soothfast docs reference Measurements and verified claims come from the latest baseline; CI gates them.

soothfast_registry#

Assertions struct#

rust · ignore
pub struct Assertions

Checked performance claims attached to a measured item. Evaluated by the runner after measurement; violations fail CI.

Bencher struct#

rust · ignore
pub struct Bencher<'a>

Single-use measurement context handed to registered runner glue.

Generated glue performs setup, then calls [Bencher::iter] (or [Bencher::iter_async]) exactly once with the workload; the active backend decides how many times (and how) the workload body actually runs.

FixtureItem struct#

rust · ignore
pub struct FixtureItem

A deterministic input-builder registered via #[soothfast::fixture].

MOCKS static#

rust · ignore
#[linkme::distributed_slice]

All mock seams registered with #[soothfast::mock_seam].

MeasuredItem struct#

rust · ignore
pub struct MeasuredItem

A benchmarked item registered via #[soothfast::measured] or #[soothfast::bench].

MockSeam trait#

rust · ignore
pub trait MockSeam: Send

A mocked backend a capture-output/test example can stand up by name. Implemented by a thin consumer-side newtype around whatever mocking crate they bring (mockito, wiremock, a hand-rolled stub server, ...). Teardown is ordinary Drop on the concrete type — no separate teardown method is needed.

MockSeamItem struct#

rust · ignore
pub struct MockSeamItem

A mock-backend setup fn registered via #[soothfast::mock_seam].

RouteItem struct#

rust · ignore
pub struct RouteItem

A declared route/operation registered via #[soothfast::route] — the code-side half of spec reconciliation (cargo soothfast spec check).

async_counters function#

rust · ignore
pub fn async_counters() -> (u64, u64)

(polls, wakes) since process start — backends diff snapshots around a body.

block_on_counting function#

rust · ignore
pub fn block_on_counting<F: Future>(fut: F) -> F::Output

Minimal std-only executor with poll/wake counting: enough to measure how a future behaves (polls to completion, wake traffic) deterministically. No spawns, no timers — a tokio-instrumented backend is future work.

verified claims
allocallocs 1 <= 1
measured as `soothfast_registry::bench_yield_chain`
median walltime (ns)352
p99 walltime (ns)354
allocations/iter1
allocated bytes/iter24
polls/iter9
wakes/iter8

fixture_items function#

rust · ignore
pub fn fixture_items() -> &'static [FixtureItem]

Read-only view of every registered fixture.

fnv1a function#

rust · ignore
pub const fn fnv1a(bytes: &[u8]) -> u64

FNV-1a 64-bit hash.

STABILITY CONTRACT: fingerprints are compared across builds and stored in lockfiles, so this algorithm is frozen. Do not change constants or logic.

verified claims
allocallocs 0 <= 0
complexityclaimed O(n); growth drift x1.03 over sizes [1024, 8192, 65536] (limit x2.5)
measured as `soothfast_registry::bench_fnv1a`
median walltime (ns)75461
p99 walltime (ns)76215
allocations/iter0
allocated bytes/iter0

measured_items function#

rust · ignore
pub fn measured_items() -> &'static [MeasuredItem]

Read-only view of every registered measured item.

mock_seam_items function#

rust · ignore
pub fn mock_seam_items() -> &'static [MockSeamItem]

Read-only view of every registered mock seam.

resolve_mock_seam function#

rust · ignore
pub fn resolve_mock_seam<'a>( items: &'a [MockSeamItem], name: &str, ) -> Result<&'a MockSeamItem, String>

Resolve a mock seam by name: an exact id match wins; otherwise exactly one ::name suffix match. Pure/testable without linking real #[mock_seam]-registered items — soothfast::mock::activate calls this against the live MOCKS slice and panics with the returned message.

route_items function#

rust · ignore
pub fn route_items() -> &'static [RouteItem]

Read-only view of every registered route.

soothfast_registry::Bencher#

iter function#

rust · ignore
pub fn iter<T>(&mut self, mut f: impl FnMut() -> T)

Hand the workload to the active backend. Call exactly once per glue call.

iter_async function#

rust · ignore
pub fn iter_async<F, Fut>(&mut self, mut f: F) where F: FnMut() -> Fut, Fut: Future,

Async workloads: each iteration drives the future to completion on the counting executor (polls/wakes feed the asyncexec backend).

soothfast_registry::MeasuredItem#

full_id function#

rust · ignore
pub fn full_id(&self) -> String

Package-qualified stable ID; survives file moves. In a lib target module_path!() starts with the crate name and the ID reads naturally (demo::lcg_checksum). In bench/test targets the first segment is the target name (every crate's bench file is soothfast), which would collide across packages and clobber shared baselines — substitute the package name for it.

soothfast_registry::RouteItem#

new function#

rust · ignore
pub const fn new( id: &'static str, spec: &'static str, operation: &'static str, method: &'static str, path: &'static str, ) -> Self

Const constructor for macro expansions.

with_shape function#

rust · ignore
pub const fn with_shape( mut self, request: Option<&'static str>, response: Option<&'static str>, status: Option<u16>, ) -> Self

Attach the shape overrides. Separate from [RouteItem::new] so that later spec dialects can add their own without growing its arity.

built with cargo soothfast docs build source