Skip to main content

Plugin

Trait Plugin 

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

Source

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

Source§

impl Plugin for OverlayPlugin

Source§

impl Plugin for PipelinePlugin

Source§

impl Plugin for SchedulerPlugin

Source§

impl Plugin for SkillsPlugin

Source§

impl Plugin for TriggerPlugin

Source§

impl Plugin for WorkflowPlugin

Implementors§

Source§

impl Plugin for RhaiPlugin

Available on crate feature rhai only.