Skip to main content

CatalogProviderList

Trait CatalogProviderList 

Source
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§

Source

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.

Source

fn catalog_names(&self) -> Vec<String>

Retrieves the list of available catalog names

Source

fn catalog(&self, name: &str) -> Option<Arc<dyn CatalogProvider>>

Retrieves a specific catalog by name, provided it exists.

Implementations§

Source§

impl dyn CatalogProviderList

Source

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.

Source

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".

Implementors§