Skip to main content

Plugin

Trait Plugin 

Source
pub trait Plugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn kind(&self) -> Kind;
    fn prepare(&self, config: &Config) -> Result<Box<dyn Instance>>;

    // Provided methods
    fn spec(&self) -> Spec { ... }
    fn params(&self) -> Vec<ParamSpec> { ... }
}
Expand description

プラグイン(設定から Instance を作る)

Required Methods§

Source

fn name(&self) -> &str

登録の名前

Source

fn kind(&self) -> Kind

Source

fn prepare(&self, config: &Config) -> Result<Box<dyn Instance>>

設定を確かめて呼び出しの準備をする

Provided Methods§

Source

fn spec(&self) -> Spec

入出力の説明

Source

fn params(&self) -> Vec<ParamSpec>

設定の項目の説明(名前・型・既定値・単位)。設定の説明はここだけ(一覧・GUI の欄・Python の plugin_spec)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§