Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Rust API reference

The full Rust API reference is generated by rustdoc and hosted at https://docs.rs/aviso. It lives close to the source so it stays in lock-step with the released code.

For an overview and worked examples, read the library guide in this book.

  • aviso crate root
  • AvisoClient: the main entry point.
  • auth: the AuthProvider trait and the five built-in providers.
  • watch: the WatchRequest builder, NotificationStream, and Trigger builders.
  • state: the StateStore trait, MemoryStore, and JsonFileStore.

docs.rs builds the documentation from the source on every release, so the version you see there matches the version on crates.io.

Stream readiness and startup

AvisoClient::watch returns a stream immediately. Creating the stream does not mean the server accepted the subscription. Call subscribe_ready() on the NotificationStream to observe first-handshake confirmation without consuming a notification. Its current value may already be true when you subscribe. Inspect that value or use wait_for(|ready| *ready) to await confirmation. The value stays true after confirmation, even during later reconnects. If it closes while false, read the stream for a possible terminal error. Cancellation can end startup without an error.

WatchRequest::with_startup_timeout(Some(duration)) sets an optional initial budget across retries. None or zero disables that budget, which is the library default. It does not limit stream lifetime. Independently, each connection must provide SSE headers and its Aviso opening event within ten seconds. Invalid responses yield ClientError::StreamProtocol, and so does an expired opening deadline before the first handshake. Once the watch has been confirmed, a reconnect that misses the deadline is retried with backoff. Unsupported base URL schemes fail at build time with ClientError::Config.

Building docs locally

If you have a checkout of the repository:

cargo doc --workspace --no-deps --open

This builds the API docs for the workspace and opens them in your browser.