pub trait Plugin:
Send
+ Sync
+ 'static {
type Config: Serialize + DeserializeOwned + Send + Sync + 'static;
type Provides: Service;
// Required method
fn apply(
&self,
ctx: &Arc<Context>,
config: Self::Config,
) -> Result<Arc<Self::Provides>, CordisError>;
}Expand description
A plugin is a declarative unit of configuration that can provide a service into a context. The registry calls apply to create the service value and then inserts it into the context with single-source discipline. The returned Arc is the live service instance that callers retrieve through ctx.get. Plain prose is used here to keep the docs readable and to avoid clever abstractions that would hide the simple flow of create then provide.
Required Associated Types§
Required Methods§
fn apply( &self, ctx: &Arc<Context>, config: Self::Config, ) -> Result<Arc<Self::Provides>, CordisError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Plugin for HttpPlugin
impl Plugin for HttpPlugin
Source§impl Plugin for OverlayPlugin
impl Plugin for OverlayPlugin
type Config = OverlayConfig
type Provides = AresConfigManager
fn apply( &self, ctx: &Arc<Context>, config: <OverlayPlugin as Plugin>::Config, ) -> Result<Arc<AresConfigManager>, CordisError>
Source§impl Plugin for PipelinePlugin
impl Plugin for PipelinePlugin
type Config = PipelineConfig
type Provides = PipelineService
fn apply( &self, ctx: &Arc<Context>, _config: <PipelinePlugin as Plugin>::Config, ) -> Result<Arc<<PipelinePlugin as Plugin>::Provides>, CordisError>
Source§impl Plugin for SchedulerPlugin
impl Plugin for SchedulerPlugin
type Config = SchedulerConfig
type Provides = SchedulerService
fn apply( &self, ctx: &Arc<Context>, config: <SchedulerPlugin as Plugin>::Config, ) -> Result<Arc<<SchedulerPlugin as Plugin>::Provides>, CordisError>
Source§impl Plugin for SkillsPlugin
impl Plugin for SkillsPlugin
type Config = SkillsPluginConfig
type Provides = SkillsService
fn apply( &self, ctx: &Arc<Context>, config: <SkillsPlugin as Plugin>::Config, ) -> Result<Arc<<SkillsPlugin as Plugin>::Provides>, CordisError>
Source§impl Plugin for TriggerPlugin
impl Plugin for TriggerPlugin
type Config = TriggerConfig
type Provides = TriggerService
fn apply( &self, ctx: &Arc<Context>, _config: <TriggerPlugin as Plugin>::Config, ) -> Result<Arc<<TriggerPlugin as Plugin>::Provides>, CordisError>
Source§impl Plugin for WorkflowPlugin
impl Plugin for WorkflowPlugin
type Config = HashMap<String, WorkflowConfig>
type Provides = WorkflowEngine
fn apply( &self, ctx: &Arc<Context>, config: <WorkflowPlugin as Plugin>::Config, ) -> Result<Arc<<WorkflowPlugin as Plugin>::Provides>, CordisError>
Implementors§
Source§impl Plugin for RhaiPlugin
Available on crate feature rhai only.
impl Plugin for RhaiPlugin
Available on crate feature
rhai only.