Skip to main content

Extensions

Struct Extensions 

Source
pub struct Extensions { /* private fields */ }
Expand description

足す拡張の集まり(Extensions::install でプロセスに入れる)

Implementations§

Source§

impl Extensions

Source

pub fn new() -> Self

Source

pub fn named(name: &'static str) -> Self

名前の付いた拡張(Extensions::merge の誤りの文に出る)

Source

pub fn name(&self) -> Option<&'static str>

拡張の名前

Source

pub fn replacing(self) -> Self

Extensions::merge で、前の拡張と同じ名前のものを置き換えてよい(無ければ誤り)

Source

pub fn plugins(self, f: fn(&mut Registry)) -> Self

プラグインを足す関数(同梱と同じ名前なら、こちらが勝つ)

Source

pub fn catalog_source(self, s: Arc<dyn LensCatalogSource + Send + Sync>) -> Self

レンズカタログの形式(同じ拡張子なら後から足したもの)

Source

pub fn surface_model(self, m: Arc<dyn SurfaceModel>) -> Self

利用者定義の面のモデル

Source

pub fn shape_model(self, m: Arc<dyn ShapeModel>) -> Self

利用者定義の形のモデル(面の種類 USERSHAPE)

Source

pub fn source_model(self, m: Arc<dyn SourceModel>) -> Self

利用者定義の光源のモデル

Source

pub fn material_catalog( self, name: &'static str, models: Vec<Arc<dyn MaterialModel>>, ) -> Self

利用者定義の材料のカタログ(名前 name で AGF のカタログと同じに引く)

Source

pub fn coating_source(self, s: Arc<dyn CoatingSource>) -> Self

膜のファイル形式(膜ファイルのフォルダの <膜の名前>.<拡張子> を膜の名前で読む。同じ拡張子なら後から足したもの)

Source

pub fn coating_catalog(self, name: &'static str, set: CoatingSet) -> Self

膜の一覧(名前 name。中の膜は .zmx の膜ファイル・フォルダの膜より先に引く。lensbench_core::usercoating)

Source

pub fn detector(self, k: DetectorKind) -> Self

プロジェクトの検出器のブロック

Source

pub fn analysis<A: Analysis>(self, a: A) -> Self

解析(CLI のサブコマンド・serve の analyze・GUI の解析)

Source

pub fn with_ext(self, f: impl Fn(&mut Ext) + Send + Sync + 'static) -> Self

表に足す関数(GUI の見せ方・Python の関数など、このクレートが型を知らない欄を足す拡張トレイトが使う)。 install・ext のときに、ほかのものを足した後で足した順に呼ぶ。install は今の表に重ねるので、同じ拡張を 2 回 install すると 2 回呼ばれる(同じものを 2 つ並べない関数にする)

Source

pub fn on_install(self, f: impl Fn() + Send + Sync + 'static) -> Self

install のときだけ呼ぶ関数(プロセスに 1 つの表に足すもの。GUI の画面の文字の訳など)。ext・merge では呼ばない。 何度 install しても困らない関数にする

Source

pub fn messages(self, table: &'static str) -> Self

誤りの文の訳の表(lensbench_core::i18n::add_table と同じ形の TSV)。install のときに足す

Source

pub fn message_tables(&self) -> &[&'static str]

足した誤りの文の訳の表

Source

pub fn analysis_names(&self) -> Vec<&'static str>

足した解析の名前(足した順)

Source

pub fn detector_kinds(&self) -> &[DetectorKind]

足した検出器の種類

Source

pub fn surface_models(&self) -> &[Arc<dyn SurfaceModel>]

足した利用者定義の面のモデル

Source

pub fn shape_models(&self) -> &[Arc<dyn ShapeModel>]

足した利用者定義の形のモデル

Source

pub fn source_models(&self) -> &[Arc<dyn SourceModel>]

足した利用者定義の光源のモデル

Source

pub fn material_catalogs( &self, ) -> &[(&'static str, Vec<Arc<dyn MaterialModel>>)]

足した材料のカタログ(名前とモデル)

Source

pub fn coating_sources(&self) -> &[Arc<dyn CoatingSource>]

足した膜のファイル形式

Source

pub fn coating_catalogs(&self) -> &[(&'static str, CoatingSet)]

足した膜の一覧(名前と膜の組)

Source

pub fn merge(self, other: Extensions) -> Result<Self>

other の分を後ろに足す。2 つが同じ名前のもの(解析・検出器・プラグイン・面と形と光源のモデル・材料のカタログ・膜の一覧と膜・カタログと膜の拡張子)を 足していれば誤り(other が Extensions::replacing なら other の方が勝つ)

Source

pub fn ext(&self) -> Result<Ext>

足したものの表(同梱の分の上に足したもの)。名前が組み込みと重なれば誤り

Source

pub fn add_to(&self, e: &mut Ext) -> Result<()>

表 e に足す(同じ名前は置き換える)。名前が組み込みと重なれば誤り

Source

pub fn install(self) -> Result<()>

プロセスの既定に入れる(何度呼んでもよい。同じ名前は置き換える)。名前が組み込みと重なれば誤り(何も入れない)。 誤りの文の訳も足す(同じ表は 1 回だけ)

Trait Implementations§

Source§

impl Clone for Extensions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Extensions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Parallelizable for T
where T: Send + Sync,

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,