1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Boxed, type-erased async return shapes used across object-safe
//! trait surfaces in `nula-*` crates.
//!
//! Two aliases live here, one for one-shot async values
//! ([`BoxFuture`]) and one for asynchronous streams ([`BoxStream`]).
//! Both resolve to the standard `Pin<Box<dyn …>>` shape with a `Send`
//! bound on every non-wasm target so callers can move the boxed
//! handle across `tokio::spawn` boundaries without ceremony. On
//! `wasm32-unknown-unknown` the `Send` bound is dropped because
//! browser-side transports (e.g. `wasm-bindgen`'s `WebSocket`) cannot
//! satisfy it.
//!
//! These aliases live in `nula-core` because every async seam in the
//! workspace — the [`crate::signer::NostrSigner`] trait, the storage
//! `NostrDatabase` trait, and the relay `WebSocketTransport` trait —
//! returns one of them. Keeping a single canonical definition here
//! avoids re-declaring the same shape in each downstream crate.
//!
//! Library code that wants to return one of these from a non-trait
//! method should still prefer `impl Future<Output = T> + Send + 'a`
//! (or `impl Stream<Item = T> + Send + 'a`) so the compiler can pick
//! a stack future / stream when possible; reach for these aliases
//! only when the trait must be object-safe.
use Future;
use Pin;
use Stream;
/// Boxed, type-erased async return value used across object-safe
/// trait surfaces.
pub type BoxFuture<'a, T> = ;
/// Boxed, type-erased async return value used across object-safe
/// trait surfaces. On `wasm32` the `Send` bound is dropped because
/// browser transports cannot satisfy it.
pub type BoxFuture<'a, T> = ;
/// Boxed, type-erased asynchronous stream used across object-safe
/// trait surfaces (notably the multi-relay `stream_events` APIs in
/// `nula-relay`).
pub type BoxStream<'a, T> = ;
/// Boxed, type-erased asynchronous stream used across object-safe
/// trait surfaces. On `wasm32` the `Send` bound is dropped because
/// browser transports cannot satisfy it.
pub type BoxStream<'a, T> = ;