pub struct Extensions { /* private fields */ }Expand description
足す拡張の集まり(Extensions::install でプロセスに入れる)
Implementations§
Source§impl Extensions
impl Extensions
pub fn new() -> Self
Sourcepub fn named(name: &'static str) -> Self
pub fn named(name: &'static str) -> Self
名前の付いた拡張(Extensions::merge の誤りの文に出る)
Sourcepub fn replacing(self) -> Self
pub fn replacing(self) -> Self
Extensions::merge で、前の拡張と同じ名前のものを置き換えてよい(無ければ誤り)
Sourcepub fn catalog_source(self, s: Arc<dyn LensCatalogSource + Send + Sync>) -> Self
pub fn catalog_source(self, s: Arc<dyn LensCatalogSource + Send + Sync>) -> Self
レンズカタログの形式(同じ拡張子なら後から足したもの)
Sourcepub fn surface_model(self, m: Arc<dyn SurfaceModel>) -> Self
pub fn surface_model(self, m: Arc<dyn SurfaceModel>) -> Self
利用者定義の面のモデル
Sourcepub fn shape_model(self, m: Arc<dyn ShapeModel>) -> Self
pub fn shape_model(self, m: Arc<dyn ShapeModel>) -> Self
利用者定義の形のモデル(面の種類 USERSHAPE)
Sourcepub fn source_model(self, m: Arc<dyn SourceModel>) -> Self
pub fn source_model(self, m: Arc<dyn SourceModel>) -> Self
利用者定義の光源のモデル
Sourcepub fn material_catalog(
self,
name: &'static str,
models: Vec<Arc<dyn MaterialModel>>,
) -> Self
pub fn material_catalog( self, name: &'static str, models: Vec<Arc<dyn MaterialModel>>, ) -> Self
利用者定義の材料のカタログ(名前 name で AGF のカタログと同じに引く)
Sourcepub fn coating_source(self, s: Arc<dyn CoatingSource>) -> Self
pub fn coating_source(self, s: Arc<dyn CoatingSource>) -> Self
膜のファイル形式(膜ファイルのフォルダの <膜の名前>.<拡張子> を膜の名前で読む。同じ拡張子なら後から足したもの)
Sourcepub fn coating_catalog(self, name: &'static str, set: CoatingSet) -> Self
pub fn coating_catalog(self, name: &'static str, set: CoatingSet) -> Self
膜の一覧(名前 name。中の膜は .zmx の膜ファイル・フォルダの膜より先に引く。lensbench_core::usercoating)
Sourcepub fn detector(self, k: DetectorKind) -> Self
pub fn detector(self, k: DetectorKind) -> Self
プロジェクトの検出器のブロック
Sourcepub fn with_ext(self, f: impl Fn(&mut Ext) + Send + Sync + 'static) -> Self
pub fn with_ext(self, f: impl Fn(&mut Ext) + Send + Sync + 'static) -> Self
表に足す関数(GUI の見せ方・Python の関数など、このクレートが型を知らない欄を足す拡張トレイトが使う)。 install・ext のときに、ほかのものを足した後で足した順に呼ぶ。install は今の表に重ねるので、同じ拡張を 2 回 install すると 2 回呼ばれる(同じものを 2 つ並べない関数にする)
Sourcepub fn on_install(self, f: impl Fn() + Send + Sync + 'static) -> Self
pub fn on_install(self, f: impl Fn() + Send + Sync + 'static) -> Self
install のときだけ呼ぶ関数(プロセスに 1 つの表に足すもの。GUI の画面の文字の訳など)。ext・merge では呼ばない。 何度 install しても困らない関数にする
Sourcepub fn messages(self, table: &'static str) -> Self
pub fn messages(self, table: &'static str) -> Self
誤りの文の訳の表(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<Self>
pub fn merge(self, other: Extensions) -> Result<Self>
other の分を後ろに足す。2 つが同じ名前のもの(解析・検出器・プラグイン・面と形と光源のモデル・材料のカタログ・膜の一覧と膜・カタログと膜の拡張子)を
足していれば誤り(other が Extensions::replacing なら other の方が勝つ)
Trait Implementations§
Source§impl Clone for Extensions
impl Clone for 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