2024-02-07 17:48:01 -05:00
|
|
|
use ruma::api::appservice::Registration;
|
|
|
|
|
|
2022-09-07 13:25:51 +02:00
|
|
|
use crate::Result;
|
|
|
|
|
|
2024-04-22 23:48:57 -04:00
|
|
|
pub(crate) trait Data: Send + Sync {
|
2024-03-05 19:48:54 -05:00
|
|
|
/// Registers an appservice and returns the ID to the caller
|
|
|
|
|
fn register_appservice(&self, yaml: Registration) -> Result<String>;
|
2022-08-07 19:42:22 +02:00
|
|
|
|
2024-03-05 19:48:54 -05:00
|
|
|
/// Remove an appservice registration
|
|
|
|
|
///
|
|
|
|
|
/// # Arguments
|
|
|
|
|
///
|
|
|
|
|
/// * `service_name` - the name you send to register the service previously
|
|
|
|
|
fn unregister_appservice(&self, service_name: &str) -> Result<()>;
|
2022-08-07 19:42:22 +02:00
|
|
|
|
2024-03-05 19:48:54 -05:00
|
|
|
fn get_registration(&self, id: &str) -> Result<Option<Registration>>;
|
2022-08-07 19:42:22 +02:00
|
|
|
|
2024-03-05 19:48:54 -05:00
|
|
|
fn iter_ids<'a>(&'a self) -> Result<Box<dyn Iterator<Item = Result<String>> + 'a>>;
|
2022-08-07 19:42:22 +02:00
|
|
|
|
2024-03-05 19:48:54 -05:00
|
|
|
fn all(&self) -> Result<Vec<(String, Registration)>>;
|
2022-08-07 19:42:22 +02:00
|
|
|
}
|