blueprint_client_tangle/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2pub mod client;
3pub mod error;
4pub mod services;
5
6#[cfg(not(any(feature = "std", feature = "web")))]
7compile_error!("`std` or `web` feature required");
8
9use auto_impl::auto_impl;
10
11#[auto_impl(Arc)]
12pub trait EventsClient<Event>: Clone + Send + Sync {
13    /// Fetch the next event from the client.
14    async fn next_event(&self) -> Option<Event>;
15    /// Fetch the latest event from the client.
16    ///
17    /// If no event has yet been fetched, the client will call [`next_event`](Self::next_event).
18    async fn latest_event(&self) -> Option<Event>;
19}
20
21// NOTE: Actual client tests are in blueprint-tangle-testing-utils
22#[test]
23fn it_works() {
24    assert_eq!(2 + 2, 4);
25}