pub trait Endpoint:
DynClone
+ Send
+ Debug {
// Required methods
fn notify<'life0, 'async_trait>(
&'life0 self,
endpoint_rx: Receiver<ValidatedNotification>,
shutdown: Receiver<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_keys(&self, hash_key: &Key) -> HashMap<String, HashSet<Key>>;
fn as_any(&self) -> &dyn Any;
}
Expand description
A data structure that contains information and functions need the server needs to send messages to endpoint.
Required Methods§
Sourcefn notify<'life0, 'async_trait>(
&'life0 self,
endpoint_rx: Receiver<ValidatedNotification>,
shutdown: Receiver<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn notify<'life0, 'async_trait>(
&'life0 self,
endpoint_rx: Receiver<ValidatedNotification>,
shutdown: Receiver<bool>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implements the server sending notifications to the Endpoint
.
Sourcefn generate_keys(&self, hash_key: &Key) -> HashMap<String, HashSet<Key>>
fn generate_keys(&self, hash_key: &Key) -> HashMap<String, HashSet<Key>>
Generates a HashMap
where the keys represent a sub-group of notifications.
This is useful for endpoints like Matrix where multiple rooms can be setup, but all notifications going to the endpoint do not go to all rooms. For endpoints like File where this is not applicable all notifications can go under a single key.