Files
irtt-rs/crates/irtt-client/README.md
T
Nils Andreas Svee 56a2a653d0 docs(crates): give each published crate its own crates.io README and examples
Each published crate (irtt-rs, irtt-client, irtt-server, irtt-stats,
irtt-proto) now points crates.io at its own README instead of
inheriting the root project README via the workspace-wide readme
default, which is removed. Each crate README is a short landing page:
what the crate is, who should use it, which sibling crate to use
instead if this isn't the right abstraction level, and links to
docs.rs and the main repository.

Add real Cargo example targets teaching irtt-client's blocking/Tokio/
managed API tiers, a basic and a multi-listener irtt-server example,
and an irtt-stats example contrasting finite vs continuous retention.
irtt-proto intentionally has none. Update each crate's top-level
rustdoc to explain its API-tier choices and point at the examples, and
enable docs.rs rustdoc example scraping for irtt-client and
irtt-server (via doc-scrape-examples on each example target, needed
because the crate has dev-dependencies).

The client examples are caller-paced against next_send_deadline()
rather than sending on every loop iteration, bound their receive wait
by the next send/timeout deadline instead of awaiting indefinitely,
poll timeouts on a short fixed cadence, and surface send/receive/close
errors instead of discarding them via unwrap_or_default()/if-let-Ok --
so they demonstrate correct pacing and terminate/report cleanly rather
than racing the server, hanging on a lost reply, or silently dropping a
failed final close.
2026-08-20 22:17:53 +07:00

1.3 KiB

irtt-client

Reusable client/session library for IRTT-compatible round-trip-time probing: socket lifecycle, open negotiation, probe send/receive, loss/duplicate/late classification, and a typed event stream.

Looking for the CLI?

If you just want to run probes from the command line, use the irtt-rs application package instead, which installs the irtt-client binary. This crate is the library the binaries are built on.

API tiers

  • Client — runtime-free blocking adapter. No Tokio dependency; this is the default build.
  • AsyncClient (feature tokio) — low-level Tokio adapter for callers that own a runtime and drive readiness directly.
  • managed (feature tokio) — a unified managed driver: ManagedClientTask / ManagedClientHandle for multi-target orchestration under a Tokio runtime, and BlockingManagedClient for synchronous callers, which owns its own dedicated current-thread runtime.

Tokio stays optional: the default build has no runtime and no Tokio dependency at all.

See examples/ in the repository for runnable examples of each tier.

Documentation

Full API documentation is on docs.rs/irtt-client.

Project

Part of irtt-rs, an independent Rust implementation of an IRTT-compatible protocol stack.