pub trait SubscriptionRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
subscription: &'life1 CreateSubscription,
) -> Pin<Box<dyn Future<Output = Result<SubscriptionWithBranch, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_by_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Subscription>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_by_id_with_branch<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_by_keys_with_branch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
branch_id: i64,
target_repo: &'life1 TargetRepo,
event_type: &'life2 EventType,
) -> Pin<Box<dyn Future<Output = Result<Option<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list_paginated<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Subscription>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_paginated_with_branches<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_remaining<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
) -> Pin<Box<dyn Future<Output = Result<i64, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: i64,
subscription: &'life1 UpdateSubscription,
) -> Pin<Box<dyn Future<Output = Result<Subscription, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_branch_id_by_subscription_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_subscriptions_by_branch_id<'life0, 'async_trait>(
&'life0 self,
branch_id: i64,
) -> Pin<Box<dyn Future<Output = Result<i64, RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_subscription_and_cascade<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Interface for subscriptions table operations.
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
subscription: &'life1 CreateSubscription,
) -> Pin<Box<dyn Future<Output = Result<SubscriptionWithBranch, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
subscription: &'life1 CreateSubscription,
) -> Pin<Box<dyn Future<Output = Result<SubscriptionWithBranch, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a new subscription and returns it.
Sourcefn get_by_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Subscription>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_by_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<Subscription>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the subscription with the given id.
Sourcefn get_by_id_with_branch<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_by_id_with_branch<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the subscription with the given id with its branch information.
Sourcefn get_by_keys_with_branch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
branch_id: i64,
target_repo: &'life1 TargetRepo,
event_type: &'life2 EventType,
) -> Pin<Box<dyn Future<Output = Result<Option<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_by_keys_with_branch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
branch_id: i64,
target_repo: &'life1 TargetRepo,
event_type: &'life2 EventType,
) -> Pin<Box<dyn Future<Output = Result<Option<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Returns the subscription with the given keys with its branch information.
Sourcefn list_paginated<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Subscription>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_paginated<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Subscription>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists some subscriptions.
last_id is the last subscription ID that is going to be excluded,
while limit is the number of subscriptions to show.
Sourcefn list_paginated_with_branches<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_paginated_with_branches<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
limit: i64,
) -> Pin<Box<dyn Future<Output = Result<Vec<SubscriptionWithBranch>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists some subscriptions with their branch information.
Sourcefn count_remaining<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
) -> Pin<Box<dyn Future<Output = Result<i64, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_remaining<'life0, 'async_trait>(
&'life0 self,
last_id: i64,
) -> Pin<Box<dyn Future<Output = Result<i64, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Counts the remaining subscriptions after last_id.
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: i64,
subscription: &'life1 UpdateSubscription,
) -> Pin<Box<dyn Future<Output = Result<Subscription, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
id: i64,
subscription: &'life1 UpdateSubscription,
) -> Pin<Box<dyn Future<Output = Result<Subscription, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates the subscription with the given id.
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deletes the subscription with the given id.
Sourcefn get_branch_id_by_subscription_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_branch_id_by_subscription_id<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the branch ID associated to the given subscription’s id.
Sourcefn count_subscriptions_by_branch_id<'life0, 'async_trait>(
&'life0 self,
branch_id: i64,
) -> Pin<Box<dyn Future<Output = Result<i64, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_subscriptions_by_branch_id<'life0, 'async_trait>(
&'life0 self,
branch_id: i64,
) -> Pin<Box<dyn Future<Output = Result<i64, RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Counts the number of subscriptions associated to the given branch_id.
Sourcefn delete_subscription_and_cascade<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_subscription_and_cascade<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = Result<(), RepositoryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deletes a subscription and cascades deletion to the associated branch if no other subscriptions exist.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".