pub trait SourceModel: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn prepare(
&self,
config: &BTreeMap<String, Value>,
) -> Result<Arc<dyn SourceInstance>, Error>;
// Provided methods
fn doc(&self) -> String { ... }
fn params(&self) -> Vec<ParamSpec> { ... }
fn example_config(&self) -> Option<BTreeMap<String, Value>> { ... }
}Expand description
光源のモデル
Required Methods§
Provided Methods§
Sourcefn example_config(&self) -> Option<BTreeMap<String, Value>>
fn example_config(&self) -> Option<BTreeMap<String, Value>>
試しの設定(拡張の検査で check_source に渡す)。既定は SourceModel::params の既定値を並べたもの
(既定値の無い項目があれば None。そのときは自分で返す)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".