Skip to main content

rig_core/serve/
mod.rs

1#![forbid(unsafe_code)]
2
3//! Handlers return a [`Reply`]: an outcome or an owned stream. [`Dispatch`]
4//! carries identity, requested delivery mode and scopes. [`ErasedHandler`]
5//! is the shared registry boundary; drivers own polling and cancellation.
6//! Provider and tool authors retain their domain traits through [`adapters`].
7//! [`Reply::written`] offers a writer that mints stream block identities.
8//!
9//! ```
10//! use rig_core::serve::Dispatch;
11//! use rig_core::effect::EffectId;
12//!
13//! let dispatch = Dispatch::new(EffectId::from_raw(1), false);
14//! assert!(!dispatch.is_stream());
15//! ```
16
17pub mod adapters;
18pub use adapters::Serving;
19mod handler;
20mod layer;
21mod map;
22mod record_buffer;
23mod recorder;
24mod writer;
25
26pub use handler::{
27    Dispatch, ErasedHandler, HandlerFuture, Observe, Reply, Serve, SinkClosed, StreamTap,
28    cancelled, serve_inline, serve_inline_with, stream_truncated,
29};
30pub use layer::{AfterServe, BeforeServe, Intercept, Layer};
31pub use record_buffer::RecordBuffer;
32pub use recorder::{DispatchContext, Recorder, catch_panics};
33pub use writer::StreamWriter;