Skip to main content

Addon

Trait Addon 

Source
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§

Source

fn as_any(&self) -> &dyn Any

Source

fn id(&self) -> &'static str

Unique identifier for the addon

Source

fn name(&self) -> &'static str

Display name of the addon

Source

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,

Initialize the addon (migrations, background tasks, etc.)

Source

fn router(&self, state: AppState) -> Option<Router>

Return API and UI routes to be merged into the main application Router

Provided Methods§

Source

fn description(&self) -> &'static str

Description of the addon

Source

fn category(&self) -> AddonCategory

Source

fn bundle(&self) -> Option<&'static str>

Source

fn developer(&self) -> &'static str

Source

fn website(&self) -> &'static str

Source

fn cost(&self) -> &'static str

Source

fn screenshots(&self) -> Vec<&'static str>

Source

fn sidebar_items(&self, _state: AppState) -> Vec<SidebarItem>

Return Sidebar menu items

Source

fn config_url(&self, state: AppState) -> Option<String>

Return the configuration URL for the addon

Source

fn settings_items(&self) -> Option<String>

Return Settings page injection items (HTML fragments or config definitions)

Source

fn inject_scripts(&self) -> Vec<ScriptInjection>

Return scripts to be injected into specific pages

Source

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"
Source

fn call_record_hook( &self, _db: &DatabaseConnection, ) -> Option<Box<dyn CallRecordHook>>

Return a hook for call record processing

Source

fn proxy_server_hook( &self, builder: SipServerBuilder, _ctx: Arc<CoreContext>, ) -> SipServerBuilder

Return a hook for proxy server builder

Source

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

Source

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

Implementors§