hermes_runtime_components/traits/
subscription.rs

1use cgp::prelude::*;
2
3use crate::traits::stream::HasStreamType;
4
5#[derive_component(SubscriptionComponent, ProvideSubscription<Runtime>)]
6#[async_trait]
7pub trait HasSubscription: HasStreamType {
8    type Subscription<Item: Async>: Async;
9
10    async fn subscribe<T>(subcription: &Self::Subscription<T>) -> Option<Self::Stream<T>>
11    where
12        T: Async;
13}