pub struct FsDiscoverer { /* private fields */ }Expand description
Filesystem-based module discoverer.
Recursively walks root looking for files named module.json, parses each
one into a DiscoveredModule, and returns them all from discover().
Implementations§
Source§impl FsDiscoverer
impl FsDiscoverer
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Create a new discoverer rooted at the given directory path.
Sourcepub fn get_executable(&self, module_name: &str) -> Option<PathBuf>
pub fn get_executable(&self, module_name: &str) -> Option<PathBuf>
Return the resolved executable path for a module, if one was declared.
Sourcepub fn executables_snapshot(&self) -> HashMap<String, PathBuf>
pub fn executables_snapshot(&self) -> HashMap<String, PathBuf>
Return a snapshot of all executable paths discovered so far.
Sourcepub fn load_descriptions(&self) -> HashMap<String, String>
pub fn load_descriptions(&self) -> HashMap<String, String>
Scan the extensions directory and return a map of module name to description.
This is a convenience method for populating description metadata that
ModuleDescriptor does not carry. Non-parseable files are silently skipped.
Trait Implementations§
Source§impl Discoverer for FsDiscoverer
impl Discoverer for FsDiscoverer
Auto Trait Implementations§
impl !Freeze for FsDiscoverer
impl RefUnwindSafe for FsDiscoverer
impl Send for FsDiscoverer
impl Sync for FsDiscoverer
impl Unpin for FsDiscoverer
impl UnsafeUnpin for FsDiscoverer
impl UnwindSafe for FsDiscoverer
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