pub struct LensCatalog { /* private fields */ }Expand description
読み込んだレンズカタログの集まり。メーカーは VendorKey で、型番は前後の空白と大文字・小文字を区別しない。
Implementations§
Source§impl LensCatalog
impl LensCatalog
Sourcepub fn load(
paths: &[PathBuf],
sources: &[&dyn LensCatalogSource],
) -> Result<LensCatalog>
pub fn load( paths: &[PathBuf], sources: &[&dyn LensCatalogSource], ) -> Result<LensCatalog>
ファイルまたはフォルダ(中のファイル、1 階層)を、拡張子が合う source で読む。 同じメーカー・型番は後に読んだものを使う。
Sourcepub fn load_registered(paths: &[PathBuf]) -> Result<Arc<LensCatalog>>
pub fn load_registered(paths: &[PathBuf]) -> Result<Arc<LensCatalog>>
load を、今の拡張の表の形式(crate::ext::current)で。読んだものを読んだファイルの
更新時刻・大きさと共に覚えておき、どれも変わっていなければ読み直さない(以前は呼ぶたびにフォルダの
全カタログを読み直した)。フォルダにファイルが増えた・減ったときも読み直す
pub fn add(&mut self, l: CatalogLens)
pub fn get(&self, vendor: &str, part: &str) -> Option<&CatalogLens>
Sourcepub fn zmx(&self, vendor: &str, part: &str) -> Result<String>
pub fn zmx(&self, vendor: &str, part: &str) -> Result<String>
(メーカー, 型番) → .zmx の本文(プロジェクトの展開に渡す形)
pub fn lenses(&self) -> &[CatalogLens]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for LensCatalog
impl Clone for LensCatalog
Source§impl Debug for LensCatalog
impl Debug for LensCatalog
Auto Trait Implementations§
impl Freeze for LensCatalog
impl RefUnwindSafe for LensCatalog
impl Send for LensCatalog
impl Sync for LensCatalog
impl Unpin for LensCatalog
impl UnsafeUnpin for LensCatalog
impl UnwindSafe for LensCatalog
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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