pub struct Extensions { /* private fields */ }Expand description
足す拡張の集まり(Extensions::install でプロセスに入れる)
Implementations§
Source§impl Extensions
impl Extensions
pub fn new() -> Extensions
Sourcepub fn named(name: &'static str) -> Extensions
pub fn named(name: &'static str) -> Extensions
名前の付いた拡張(Extensions::merge の誤りの文に出る)
Sourcepub fn replacing(self) -> Extensions
pub fn replacing(self) -> Extensions
Extensions::merge で、前の拡張と同じ名前のものを置き換えてよい(無ければ誤り)
Sourcepub fn plugins(self, f: fn(&mut Registry)) -> Extensions
pub fn plugins(self, f: fn(&mut Registry)) -> Extensions
プラグインを足す関数(同梱と同じ名前なら、こちらが勝つ)
Sourcepub fn catalog_source(
self,
s: Arc<dyn LensCatalogSource + Send + Sync>,
) -> Extensions
pub fn catalog_source( self, s: Arc<dyn LensCatalogSource + Send + Sync>, ) -> Extensions
レンズカタログの形式(同じ拡張子なら後から足したもの)
Sourcepub fn surface_model(self, m: Arc<dyn SurfaceModel>) -> Extensions
pub fn surface_model(self, m: Arc<dyn SurfaceModel>) -> Extensions
利用者定義の面のモデル
Sourcepub fn shape_model(self, m: Arc<dyn ShapeModel>) -> Extensions
pub fn shape_model(self, m: Arc<dyn ShapeModel>) -> Extensions
利用者定義の形のモデル(面の種類 USERSHAPE)
Sourcepub fn source_model(self, m: Arc<dyn SourceModel>) -> Extensions
pub fn source_model(self, m: Arc<dyn SourceModel>) -> Extensions
利用者定義の光源のモデル
Sourcepub fn material_catalog(
self,
name: &'static str,
models: Vec<Arc<dyn MaterialModel>>,
) -> Extensions
pub fn material_catalog( self, name: &'static str, models: Vec<Arc<dyn MaterialModel>>, ) -> Extensions
利用者定義の材料のカタログ(名前 name で AGF のカタログと同じに引く)
Sourcepub fn coating_source(self, s: Arc<dyn CoatingSource>) -> Extensions
pub fn coating_source(self, s: Arc<dyn CoatingSource>) -> Extensions
膜のファイル形式(膜ファイルのフォルダの <膜の名前>.<拡張子> を膜の名前で読む。同じ拡張子なら後から足したもの)
Sourcepub fn coating_catalog(self, name: &'static str, set: CoatingSet) -> Extensions
pub fn coating_catalog(self, name: &'static str, set: CoatingSet) -> Extensions
膜の一覧(名前 name。中の膜は .zmx の膜ファイル・フォルダの膜より先に引く。lensbench_core::usercoating)
Sourcepub fn detector(self, k: DetectorKind) -> Extensions
pub fn detector(self, k: DetectorKind) -> Extensions
プロジェクトの検出器のブロック
Sourcepub fn analysis<A>(self, a: A) -> Extensionswhere
A: Analysis,
pub fn analysis<A>(self, a: A) -> Extensionswhere
A: Analysis,
解析(CLI のサブコマンド・serve の analyze・GUI の解析)
Sourcepub fn with_ext(
self,
f: impl Fn(&mut Ext) + Send + Sync + 'static,
) -> Extensions
pub fn with_ext( self, f: impl Fn(&mut Ext) + Send + Sync + 'static, ) -> Extensions
表に足す関数(GUI の見せ方・Python の関数など、このクレートが型を知らない欄を足す拡張トレイトが使う)。 install・ext のときに、ほかのものを足した後で足した順に呼ぶ。install は今の表に重ねるので、同じ拡張を 2 回 install すると 2 回呼ばれる(同じものを 2 つ並べない関数にする)
Sourcepub fn on_install(self, f: impl Fn() + Send + Sync + 'static) -> Extensions
pub fn on_install(self, f: impl Fn() + Send + Sync + 'static) -> Extensions
install のときだけ呼ぶ関数(プロセスに 1 つの表に足すもの。GUI の画面の文字の訳など)。ext・merge では呼ばない。 何度 install しても困らない関数にする
Sourcepub fn messages(self, table: &'static str) -> Extensions
pub fn messages(self, table: &'static str) -> Extensions
誤りの文の訳の表(lensbench_core::i18n::add_table と同じ形の TSV)。install のときに足す
Sourcepub fn message_tables(&self) -> &[&'static str]
pub fn message_tables(&self) -> &[&'static str]
足した誤りの文の訳の表
Sourcepub fn analysis_names(&self) -> Vec<&'static str>
pub fn analysis_names(&self) -> Vec<&'static str>
足した解析の名前(足した順)
Sourcepub fn detector_kinds(&self) -> &[DetectorKind]
pub fn detector_kinds(&self) -> &[DetectorKind]
足した検出器の種類
Sourcepub fn surface_models(&self) -> &[Arc<dyn SurfaceModel>]
pub fn surface_models(&self) -> &[Arc<dyn SurfaceModel>]
足した利用者定義の面のモデル
Sourcepub fn shape_models(&self) -> &[Arc<dyn ShapeModel>]
pub fn shape_models(&self) -> &[Arc<dyn ShapeModel>]
足した利用者定義の形のモデル
Sourcepub fn source_models(&self) -> &[Arc<dyn SourceModel>]
pub fn source_models(&self) -> &[Arc<dyn SourceModel>]
足した利用者定義の光源のモデル
Sourcepub fn material_catalogs(
&self,
) -> &[(&'static str, Vec<Arc<dyn MaterialModel>>)]
pub fn material_catalogs( &self, ) -> &[(&'static str, Vec<Arc<dyn MaterialModel>>)]
足した材料のカタログ(名前とモデル)
Sourcepub fn coating_sources(&self) -> &[Arc<dyn CoatingSource>]
pub fn coating_sources(&self) -> &[Arc<dyn CoatingSource>]
足した膜のファイル形式
Sourcepub fn coating_catalogs(&self) -> &[(&'static str, CoatingSet)]
pub fn coating_catalogs(&self) -> &[(&'static str, CoatingSet)]
足した膜の一覧(名前と膜の組)
Sourcepub fn merge(self, other: Extensions) -> Result<Extensions, Error>
pub fn merge(self, other: Extensions) -> Result<Extensions, Error>
other の分を後ろに足す。2 つが同じ名前のもの(解析・検出器・プラグイン・面と形と光源のモデル・材料のカタログ・膜の一覧と膜・カタログと膜の拡張子)を
足していれば誤り(other が Extensions::replacing なら other の方が勝つ)
Trait Implementations§
Source§impl Clone for Extensions
impl Clone for Extensions
Source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for Extensions
impl Default for Extensions
Source§fn default() -> Extensions
fn default() -> Extensions
Auto Trait Implementations§
impl !RefUnwindSafe for Extensions
impl !UnwindSafe for Extensions
impl Freeze for Extensions
impl Send for Extensions
impl Sync for Extensions
impl Unpin for Extensions
impl UnsafeUnpin for Extensions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more