pub trait GraphqlSubscriptionSource: Send + Sync {
// Required method
fn subscribe_stream<'a>(
&'a self,
subject: &'a Subject,
) -> Pin<Box<dyn Future<Output = Result<JsonValueStream, Error>> + Send + 'a>>;
}Expand description
A source of live event streams keyed by subject. Implementations are
typically backed by themql-sse’s TokioSsePublisher (broadcast
channel) but any transport that can produce a stream of JSON values
for a given subject can implement this trait.
This trait is dyn-compatible so SubscriptionRoot can hold
Arc<dyn GraphqlSubscriptionSource>.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".