pub struct EndfRetriever { /* private fields */ }Expand description
ENDF file retrieval manager with local caching.
Implementations§
Source§impl EndfRetriever
impl EndfRetriever
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new retriever with default cache location (~/.cache/nereids/endf/).
Sourcepub fn with_cache_dir(cache_dir: impl Into<PathBuf>) -> Self
pub fn with_cache_dir(cache_dir: impl Into<PathBuf>) -> Self
Create a retriever with a custom cache directory.
Sourcepub fn get_endf_file(
&self,
isotope: &Isotope,
library: EndfLibrary,
mat: u32,
) -> Result<(PathBuf, String), EndfRetrievalError>
pub fn get_endf_file( &self, isotope: &Isotope, library: EndfLibrary, mat: u32, ) -> Result<(PathBuf, String), EndfRetrievalError>
Retrieve the ENDF file for an isotope, using cache if available.
Returns the path to the cached ENDF file and its contents as a string.
§Arguments
isotope— The isotope to retrieve data for.library— The ENDF library to use.mat— The ENDF MAT (material) number.
Sourcepub fn load_local(path: &Path) -> Result<String, EndfRetrievalError>
pub fn load_local(path: &Path) -> Result<String, EndfRetrievalError>
Load an ENDF file from a local path (no download).
Sourcepub fn clear_cache(
&self,
library: Option<EndfLibrary>,
) -> Result<(), EndfRetrievalError>
pub fn clear_cache( &self, library: Option<EndfLibrary>, ) -> Result<(), EndfRetrievalError>
Clear the cache for a specific library, or all if None.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EndfRetriever
impl RefUnwindSafe for EndfRetriever
impl Send for EndfRetriever
impl Sync for EndfRetriever
impl Unpin for EndfRetriever
impl UnwindSafe for EndfRetriever
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