pub trait Spec: Send + Sync {
type Topic: Send + Sync + Clone + Eq + PartialEq + Ord + PartialOrd + Hash + DeserializeOwned + Serialize;
type Event: Event<Topic = Self::Topic> + Send + Sync + Eq + PartialEq + DeserializeOwned + Serialize;
type SubscriptionId: Clone + Default + Eq + PartialEq + Ord + PartialOrd + Hash + Send + Sync + DeserializeOwned + Serialize;
type Context;
// Required methods
fn new_instance(context: Self::Context) -> Arc<Self>
where Self: Sized;
fn fetch_events<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
topics: Vec<<Self::Event as Event>::Topic>,
reply_to: Subscriber<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Sized + 'async_trait,
'life0: 'async_trait;
}Expand description
Pubsub settings
Required Associated Types§
Sourcetype Topic: Send + Sync + Clone + Eq + PartialEq + Ord + PartialOrd + Hash + DeserializeOwned + Serialize
type Topic: Send + Sync + Clone + Eq + PartialEq + Ord + PartialOrd + Hash + DeserializeOwned + Serialize
Topic
Sourcetype Event: Event<Topic = Self::Topic> + Send + Sync + Eq + PartialEq + DeserializeOwned + Serialize
type Event: Event<Topic = Self::Topic> + Send + Sync + Eq + PartialEq + DeserializeOwned + Serialize
Event
Sourcetype SubscriptionId: Clone + Default + Eq + PartialEq + Ord + PartialOrd + Hash + Send + Sync + DeserializeOwned + Serialize
type SubscriptionId: Clone + Default + Eq + PartialEq + Ord + PartialOrd + Hash + Send + Sync + DeserializeOwned + Serialize
Subscription Id
Required Methods§
Sourcefn new_instance(context: Self::Context) -> Arc<Self>where
Self: Sized,
fn new_instance(context: Self::Context) -> Arc<Self>where
Self: Sized,
Create a new instance from a given context
Sourcefn fetch_events<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
topics: Vec<<Self::Event as Event>::Topic>,
reply_to: Subscriber<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
'life0: 'async_trait,
fn fetch_events<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
topics: Vec<<Self::Event as Event>::Topic>,
reply_to: Subscriber<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: Sized + 'async_trait,
'life0: 'async_trait,
Callback function that is called on new subscriptions, to back-fill optionally the previous events