pub trait CatalogProviderList:
Any
+ Debug
+ Sync
+ Send {
// Required methods
fn register_catalog(
&self,
name: String,
catalog: Arc<dyn CatalogProvider>,
) -> Option<Arc<dyn CatalogProvider>>;
fn catalog_names(&self) -> Vec<String>;
fn catalog(&self, name: &str) -> Option<Arc<dyn CatalogProvider>>;
}Expand description
Represent a list of named CatalogProviders.
Please see the documentation on CatalogProvider for details of
implementing a custom catalog.
Required Methods§
Sourcefn register_catalog(
&self,
name: String,
catalog: Arc<dyn CatalogProvider>,
) -> Option<Arc<dyn CatalogProvider>>
fn register_catalog( &self, name: String, catalog: Arc<dyn CatalogProvider>, ) -> Option<Arc<dyn CatalogProvider>>
Adds a new catalog to this catalog list If a catalog of the same name existed before, it is replaced in the list and returned.
Sourcefn catalog_names(&self) -> Vec<String>
fn catalog_names(&self) -> Vec<String>
Retrieves the list of available catalog names
Implementations§
Source§impl dyn CatalogProviderList
impl dyn CatalogProviderList
Sourcepub fn is<T: CatalogProviderList>(&self) -> bool
pub fn is<T: CatalogProviderList>(&self) -> bool
Returns true if the catalog provider list is of type T.
Prefer this over downcast_ref::<T>().is_some(). Works correctly when
called on Arc<dyn CatalogProviderList> via auto-deref.
Sourcepub fn downcast_ref<T: CatalogProviderList>(&self) -> Option<&T>
pub fn downcast_ref<T: CatalogProviderList>(&self) -> Option<&T>
Attempts to downcast this catalog provider list to a concrete type T,
returning None if the provider list is not of that type.
Works correctly when called on Arc<dyn CatalogProviderList> via
auto-deref, unlike (&arc as &dyn Any).downcast_ref::<T>() which would
attempt to downcast the Arc itself.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".