Trait up_rust::core::usubscription::USubscription
source · pub trait USubscription: Send + Sync {
// Required methods
fn subscribe<'life0, 'async_trait>(
&'life0 self,
subscription_request: SubscriptionRequest,
) -> Pin<Box<dyn Future<Output = Result<SubscriptionResponse, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
unsubscribe_request: UnsubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_subscriptions<'life0, 'async_trait>(
&'life0 self,
fetch_subscriptions_request: FetchSubscriptionsRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchSubscriptionsResponse, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn register_for_notifications<'life0, 'async_trait>(
&'life0 self,
notifications_register_request: NotificationsRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unregister_for_notifications<'life0, 'async_trait>(
&'life0 self,
notifications_unregister_request: NotificationsRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn fetch_subscribers<'life0, 'async_trait>(
&'life0 self,
fetch_subscribers_request: FetchSubscribersRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchSubscribersResponse, UStatus>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
The uProtocol Application Layer client interface to the uSubscription service.
Please refer to the uSubscription service specification for details.
Required Methods§
sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
subscription_request: SubscriptionRequest,
) -> Pin<Box<dyn Future<Output = Result<SubscriptionResponse, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
subscription_request: SubscriptionRequest,
) -> Pin<Box<dyn Future<Output = Result<SubscriptionResponse, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to a topic, using a SubscriptionRequest
§Parameters
subscription_request- A request to subscribe
§Returns
SubscriptionResponsedetailing if subscription was successful with other metadata
sourcefn unsubscribe<'life0, 'async_trait>(
&'life0 self,
unsubscribe_request: UnsubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
unsubscribe_request: UnsubscribeRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Unsubscribe to a topic, using an UnsubscribeRequest
§Parameters
unsubscribe_request- A request to unsubscribe
§Returns
UStatusdetailing if unsubscription was successful and if not why not
sourcefn fetch_subscriptions<'life0, 'async_trait>(
&'life0 self,
fetch_subscriptions_request: FetchSubscriptionsRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchSubscriptionsResponse, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_subscriptions<'life0, 'async_trait>(
&'life0 self,
fetch_subscriptions_request: FetchSubscriptionsRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchSubscriptionsResponse, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch all subscriptions for a given topic or subscriber contained inside a FetchSubscriptionsRequest
§Parameters
fetch_subscriptions_request- A request to fetch subscriptions given a topic or subscriber
§Returns
FetchSubscriptionsResponsedetailing the zero or more subscriptions’ info
sourcefn register_for_notifications<'life0, 'async_trait>(
&'life0 self,
notifications_register_request: NotificationsRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_for_notifications<'life0, 'async_trait>(
&'life0 self,
notifications_register_request: NotificationsRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register for notifications relevant to a given topic inside a NotificationsRequest
changing in subscription status.
§Parameters
notifications_register_request- A request to receive changes to subscription status
§Returns
UStatusdetailing if notification registration was successful and if not why not
sourcefn unregister_for_notifications<'life0, 'async_trait>(
&'life0 self,
notifications_unregister_request: NotificationsRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unregister_for_notifications<'life0, 'async_trait>(
&'life0 self,
notifications_unregister_request: NotificationsRequest,
) -> Pin<Box<dyn Future<Output = Result<(), UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Unregister for notifications relevant to a given topic inside a NotificationsRequest
changing in subscription status.
§Parameters
notifications_unregister_request- A request to no longer receive changes to subscription status
§Returns
UStatusdetailing if notification unregistration was successful and if not why not
sourcefn fetch_subscribers<'life0, 'async_trait>(
&'life0 self,
fetch_subscribers_request: FetchSubscribersRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchSubscribersResponse, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_subscribers<'life0, 'async_trait>(
&'life0 self,
fetch_subscribers_request: FetchSubscribersRequest,
) -> Pin<Box<dyn Future<Output = Result<FetchSubscribersResponse, UStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a list of subscribers that are currently subscribed to a given topic in a FetchSubscribersRequest
§Parameters
fetch_subscribers_request- Request containing topic for which we’d like all subscribers’ info
§Returns
FetchSubscriptionsResponsedetailing subscriber info for the provided topic