how-far0.1

PROGRESS & CANCELLATION FOR RUST LIBRARIES

Progress that follows
your functions.

One &dyn Pulse argument. Ordinary functions and results. Named stages when you need structure.

no_std + alloc · Your caller chooses what to observe

Inside your libraryRust
// Bind definitions to variables.
let (mut stages, [decode, resize]) =
    Stages::define(pulse, [
        PhaseSpec::new("decode", 4, Total::Unknown),
        PhaseSpec::new("resize", 3, Total::Unknown),
    ]);

// Call your functions as usual.
let decode = stages.begin(decode);
let pixels = decode_image(input, &decode)
    .finish_phase(decode)?;

let resize = stages.begin(resize);
let pixels = resize_image(pixels, &resize)
    .finish_phase(resize)?;

stages.complete(Ok(pixels))
The result finishes the stage before ? propagates an error.

FOLLOW THE WORK

A small interface.
A visible lifecycle.

Step through snapshots recorded by the Rust tracker. These are illustrative events, not timings or benchmarks.

Real tracker snapshots

LOADING

Loading recorded events…

The guides below work without JavaScript.

Illustrative pace · actual tracker states

What the caller observes—

Progress counts work. Completion records its outcome.

01

Keep your return types

Return your own Result<T, E>. Implement AsStopReason on your error to distinguish cancellation from failure.

02

Compose ordinary calls

Stages can take different inputs and return different types. Forked handles use the same result handoff; your runtime schedules the work.

03

Let the caller choose

Pass NoPulse, a stop token adapter, or a tracker. Your library reports work. Its caller owns the display and final completion.

THREE CRATES, ONE DIRECTION

Add what you need.

Start with the core in your library. Tracking and diagnostics can stay in development dependencies until an application needs them.

[dependencies]
how-far = "0.1.0"

A guide for your next step.

01 / GET STARTED

A function and its caller →

A complete example, dependency setup and the first result handoff.

02 / COMPOSE

Stages, errors and fork–join →

Bind definitions to variables and compose different operations.

03 / VERIFY

Test what your library reports →

Check cancellation, inspect diagnostics and tune checkpoint cadence.