Skip to main content

SubscriptionRepository

Trait SubscriptionRepository 

Source
pub trait SubscriptionRepository: Send + Sync {
    // Required methods
    fn create_event_subscription<'life0, 'life1, 'async_trait>(
        &'life0 self,
        subscription: &'life1 EventSubscription,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_subscriptions<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        event_name: &'life1 str,
        event_key: &'life2 str,
        as_of: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<EventSubscription>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn terminate_subscription<'life0, 'life1, 'async_trait>(
        &'life0 self,
        subscription_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_subscription<'life0, 'life1, 'async_trait>(
        &'life0 self,
        subscription_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<EventSubscription>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_first_open_subscription<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        event_name: &'life1 str,
        event_key: &'life2 str,
        as_of: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<EventSubscription>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set_subscription_token<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        subscription_id: &'life1 str,
        token: &'life2 str,
        worker_id: &'life3 str,
        expiry: DateTime<Utc>,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn clear_subscription_token<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        subscription_id: &'life1 str,
        token: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Persistence for event subscriptions.

Required Methods§

Source

fn create_event_subscription<'life0, 'life1, 'async_trait>( &'life0 self, subscription: &'life1 EventSubscription, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_subscriptions<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, event_name: &'life1 str, event_key: &'life2 str, as_of: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Vec<EventSubscription>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn terminate_subscription<'life0, 'life1, 'async_trait>( &'life0 self, subscription_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_subscription<'life0, 'life1, 'async_trait>( &'life0 self, subscription_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<EventSubscription>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get_first_open_subscription<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, event_name: &'life1 str, event_key: &'life2 str, as_of: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<Option<EventSubscription>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn set_subscription_token<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, subscription_id: &'life1 str, token: &'life2 str, worker_id: &'life3 str, expiry: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn clear_subscription_token<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, subscription_id: &'life1 str, token: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§