pub struct DirCatalog { /* private fields */ }Expand description
Implements ModuleCatalog to load MeTTa modules from a file-system directory trying a number of FsModuleFormat formats in succession
Trait Implementations§
Source§impl Debug for DirCatalog
impl Debug for DirCatalog
Source§impl ModuleCatalog for DirCatalog
impl ModuleCatalog for DirCatalog
Source§fn display_name(&self) -> String
fn display_name(&self) -> String
The name of the catalog, to be displayed to the user
Source§fn lookup(&self, name: &str) -> Vec<ModuleDescriptor>
fn lookup(&self, name: &str) -> Vec<ModuleDescriptor>
Returns the ModuleDescriptor for every module in the
ModuleCatalog with the specified nameSource§fn get_loader(
&self,
descriptor: &ModuleDescriptor,
) -> Result<Box<dyn ModuleLoader>, String>
fn get_loader( &self, descriptor: &ModuleDescriptor, ) -> Result<Box<dyn ModuleLoader>, String>
Returns a ModuleLoader for the specified module from the
ModuleCatalogSource§fn lookup_with_uid(&self, name: &str, uid: Option<u64>) -> Vec<ModuleDescriptor>
fn lookup_with_uid(&self, name: &str, uid: Option<u64>) -> Vec<ModuleDescriptor>
Returns the ModuleDescriptor for every module in the
ModuleCatalog with the specified name,
and uid matchSource§fn lookup_with_version_req(
&self,
name: &str,
version_req: Option<&VersionReq>,
) -> Vec<ModuleDescriptor>
fn lookup_with_version_req( &self, name: &str, version_req: Option<&VersionReq>, ) -> Vec<ModuleDescriptor>
Returns the ModuleDescriptor for every module in the
ModuleCatalog with the specified name
matching the version requirements Read moreSource§fn lookup_newest_with_version_req(
&self,
name: &str,
version_req: Option<&VersionReq>,
) -> Option<ModuleDescriptor>
fn lookup_newest_with_version_req( &self, name: &str, version_req: Option<&VersionReq>, ) -> Option<ModuleDescriptor>
Returns the ModuleDescriptor for the newest module in the
ModuleCatalog, that matches the
specified version requirement, or None if no module exists Read moreSource§fn lookup_newest_with_uid_and_version_req(
&self,
name: &str,
uid: Option<u64>,
version_req: Option<&VersionReq>,
) -> Option<ModuleDescriptor>
fn lookup_newest_with_uid_and_version_req( &self, name: &str, uid: Option<u64>, version_req: Option<&VersionReq>, ) -> Option<ModuleDescriptor>
Returns the ModuleDescriptor for the newest module in the
ModuleCatalog, that matches the
specified name, uid, and version requirement, or None if no module exists Read moreSource§fn list<'a>(&'a self) -> Option<Box<dyn Iterator<Item = ModuleDescriptor> + 'a>>
fn list<'a>(&'a self) -> Option<Box<dyn Iterator<Item = ModuleDescriptor> + 'a>>
Returns an iterator over every module available in the catalog. May not be supported
by all catalog implementations
Source§fn list_names<'a>(&'a self) -> Option<Box<dyn Iterator<Item = String> + 'a>>
fn list_names<'a>(&'a self) -> Option<Box<dyn Iterator<Item = String> + 'a>>
Returns an iterator over every unique module name in the catalog. May not be supported
by all catalog implementations
Source§fn list_name_uid_pairs<'a>(
&'a self,
) -> Option<Box<dyn Iterator<Item = (String, Option<u64>)> + 'a>>
fn list_name_uid_pairs<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = (String, Option<u64>)> + 'a>>
Returns an iterator over every unique (module name, uid) pair in the catalog. May not
be supported by all catalog implementations
Source§fn as_any(&self) -> Option<&dyn Any>
fn as_any(&self) -> Option<&dyn Any>
Returns the catalog as an Any in order to get back to the underlying object
Source§fn sync_toc(&self, _update_mode: UpdateMode) -> Result<(), String>
fn sync_toc(&self, _update_mode: UpdateMode) -> Result<(), String>
Synchronize the catalog’s internal tables, so fresh upstream info is reflected
locally. Does not fetch any modules
Source§fn as_managed(&self) -> Option<&dyn ManagedCatalog>
fn as_managed(&self) -> Option<&dyn ManagedCatalog>
Returns the catalog as a ManagedCatalog if the catalog supports active management
Auto Trait Implementations§
impl Freeze for DirCatalog
impl !RefUnwindSafe for DirCatalog
impl Send for DirCatalog
impl Sync for DirCatalog
impl Unpin for DirCatalog
impl !UnwindSafe for DirCatalog
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request