pub trait Addon: Send + Sync {
Show 21 methods
// Required methods
fn as_any(&self) -> &dyn Any;
fn id(&self) -> &'static str;
fn name(&self) -> &'static str;
fn initialize<'life0, 'async_trait>(
&'life0 self,
state: AppState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn router(&self, state: AppState) -> Option<Router>;
// Provided methods
fn description(&self) -> &'static str { ... }
fn category(&self) -> AddonCategory { ... }
fn bundle(&self) -> Option<&'static str> { ... }
fn developer(&self) -> &'static str { ... }
fn website(&self) -> &'static str { ... }
fn cost(&self) -> &'static str { ... }
fn screenshots(&self) -> Vec<&'static str> { ... }
fn sidebar_items(&self, _state: AppState) -> Vec<SidebarItem> { ... }
fn config_url(&self, state: AppState) -> Option<String> { ... }
fn settings_items(&self) -> Option<String> { ... }
fn inject_scripts(&self) -> Vec<ScriptInjection> { ... }
fn locales_dir(&self) -> Option<String> { ... }
fn call_record_hook(
&self,
_db: &DatabaseConnection,
) -> Option<Box<dyn CallRecordHook>> { ... }
fn proxy_server_hook(
&self,
builder: SipServerBuilder,
_ctx: Arc<CoreContext>,
) -> SipServerBuilder { ... }
fn seed_fixtures<'life0, 'async_trait>(
&'life0 self,
_state: AppState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: AppState,
_identifier: &'life1 str,
_password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
}Required Methods§
fn as_any(&self) -> &dyn Any
Provided Methods§
Sourcefn description(&self) -> &'static str
fn description(&self) -> &'static str
Description of the addon
fn category(&self) -> AddonCategory
fn bundle(&self) -> Option<&'static str>
fn developer(&self) -> &'static str
fn website(&self) -> &'static str
fn cost(&self) -> &'static str
fn screenshots(&self) -> Vec<&'static str>
Return Sidebar menu items
Sourcefn config_url(&self, state: AppState) -> Option<String>
fn config_url(&self, state: AppState) -> Option<String>
Return the configuration URL for the addon
Sourcefn settings_items(&self) -> Option<String>
fn settings_items(&self) -> Option<String>
Return Settings page injection items (HTML fragments or config definitions)
Sourcefn inject_scripts(&self) -> Vec<ScriptInjection>
fn inject_scripts(&self) -> Vec<ScriptInjection>
Return scripts to be injected into specific pages
Sourcefn locales_dir(&self) -> Option<String>
fn locales_dir(&self) -> Option<String>
Return the path to this addon’s locale directory, if any.
Translation files in this directory (e.g. en.toml, zh.toml) will
be merged into the global i18n cache under the addon’s own namespace.
Conventionally the keys should be prefixed with the addon id, e.g.:
# src/addons/queue/locales/en.toml
[queue]
title = "Call Queues"Sourcefn call_record_hook(
&self,
_db: &DatabaseConnection,
) -> Option<Box<dyn CallRecordHook>>
fn call_record_hook( &self, _db: &DatabaseConnection, ) -> Option<Box<dyn CallRecordHook>>
Return a hook for call record processing
Sourcefn proxy_server_hook(
&self,
builder: SipServerBuilder,
_ctx: Arc<CoreContext>,
) -> SipServerBuilder
fn proxy_server_hook( &self, builder: SipServerBuilder, _ctx: Arc<CoreContext>, ) -> SipServerBuilder
Return a hook for proxy server builder
Sourcefn seed_fixtures<'life0, 'async_trait>(
&'life0 self,
_state: AppState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn seed_fixtures<'life0, 'async_trait>(
&'life0 self,
_state: AppState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Seed fixtures for the addon
Sourcefn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: AppState,
_identifier: &'life1 str,
_password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: AppState,
_identifier: &'life1 str,
_password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Model>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticate a user