Skip to content

docs: add testing, asyncapi, and DI example blocks to the README#131

Merged
powersemmi merged 1 commit into
mainfrom
docs/readme-examples
Jul 3, 2026
Merged

docs: add testing, asyncapi, and DI example blocks to the README#131
powersemmi merged 1 commit into
mainfrom
docs/readme-examples

Conversation

@powersemmi

Copy link
Copy Markdown
Owner

Description

Expand the README with three example blocks so a reader sees the common flows without leaving the page:

  • Testing the service (was the one-line Test it) - drive a built app with the TestApp harness against the in-memory broker, inject input, and assert handler settlement plus a downstream publish.
  • Project documentation (was the one-line Documentation) - build the AsyncAPI spec and the interactive viewer HTML programmatically with build_spec / render_viewer_html. The CLI ruststream asyncapi gen already appears under Run it, so this covers the in-process path.
  • Injecting dependencies (new) - declare app state, derive FromRef, and take a dependency as a State<T> handler argument instead of reaching through ctx.state().

Each block links to its compiling examples/*.rs source of truth (examples/testing.rs, examples/asyncapi_http.rs, examples/from_context.rs) so the snippets cannot silently drift; GitHub-rendered README does not support file includes, so the snippets are inline fences trimmed from those examples.

Also drop the stale ruststream-py Ecosystem line: Python bindings were removed, the reference no longer points at a maintained crate.

Fixes #130

Type of change

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (removing or renaming public API, changing a signature, tightening bounds, or
    raising the MSRV - a minor version bump pre-1.0)
  • This change requires a documentation update

Checklist

  • My code follows the project's style guidelines (just check passes: rustfmt, clippy, and
    cargo check with all features and with --no-default-features)
  • I have performed a self-review of my own code
  • I have made the necessary changes to the documentation (rustdoc and/or the docs site)
  • My changes generate no new warnings (clippy runs with -D warnings)
  • I have added tests that validate my fix or new feature
  • New and existing tests pass locally (just test)
  • Public items carry a compiling # Examples doctest, and user-facing changes are reflected in
    examples/ where applicable

Expand the README with three example blocks so a reader sees the common
flows without leaving the page: unit-testing a service with the `TestApp`
harness against the in-memory broker, building the AsyncAPI spec and viewer
HTML programmatically, and injecting state-backed dependencies into a
handler via `#[derive(FromRef)]` and `State<T>`. Each block links to its
compiling `examples/*.rs` source of truth so the snippets cannot silently
drift.

Drop the stale `ruststream-py` Ecosystem line: Python bindings were
removed, the reference no longer points at a maintained crate.

Docs-only; no code or API change.
@powersemmi powersemmi self-assigned this Jul 3, 2026
@powersemmi powersemmi added the documentation Improvements or additions to documentation label Jul 3, 2026
@powersemmi powersemmi merged commit 7d75457 into main Jul 3, 2026
11 checks passed
@powersemmi powersemmi deleted the docs/readme-examples branch July 3, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add testing, AsyncAPI generation, and dependency-injection examples to the README

1 participant