pub trait ShapeModel: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn prepare(&self, config: &Config) -> Result<Arc<dyn ShapeInstance>>;
// Provided methods
fn doc(&self) -> String { ... }
fn params(&self) -> Vec<ParamSpec> { ... }
fn example_config(&self) -> Option<Config> { ... }
fn example_radius(&self) -> f64 { ... }
}Expand description
利用者定義の形のモデル(設定から ShapeInstance を作る)
Required Methods§
Provided Methods§
Sourcefn example_config(&self) -> Option<Config>
fn example_config(&self) -> Option<Config>
試しの設定(拡張の検査で check_shape に渡す)。既定は ShapeModel::params の既定値を並べたもの
(既定値の無い項目があれば None。そのときは自分で返す)
Sourcefn example_radius(&self) -> f64
fn example_radius(&self) -> f64
試しの設定で確かめる半径 [mm](形が有効な半直径。既定 10)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".