espresso_api/v1/hotshot_events.rs
1//! V1 hotshot-events API.
2//!
3//! Mirrors the tide-disco endpoints defined in `hotshot-events-service/api/hotshot_events.toml`.
4
5use async_trait::async_trait;
6use futures::stream::BoxStream;
7use serde::Serialize;
8
9#[async_trait]
10pub trait HotShotEventsApi {
11 type Event: Serialize + Send + Sync + 'static;
12 type StartupInfo: Serialize + Send + Sync + 'static;
13
14 async fn startup_info(&self) -> anyhow::Result<Self::StartupInfo>;
15
16 async fn events(&self) -> anyhow::Result<BoxStream<'static, Self::Event>>;
17}