pub struct DatabaseRegistry { /* private fields */ }Expand description
Explicit database backend registry.
Implementations§
Source§impl DatabaseRegistry
impl DatabaseRegistry
Sourcepub fn register(
&mut self,
name: impl Into<String>,
factory: Arc<dyn DatabaseFactory>,
) -> AppResult<()>
pub fn register( &mut self, name: impl Into<String>, factory: Arc<dyn DatabaseFactory>, ) -> AppResult<()>
Register a backend factory under name.
Sourcepub fn contains(&self, name: &str) -> bool
pub fn contains(&self, name: &str) -> bool
Return true when the backend has been explicitly registered.
Sourcepub async fn build(
&self,
config: &DatabaseConfig,
) -> AppResult<Arc<dyn DatabaseClient>>
pub async fn build( &self, config: &DatabaseConfig, ) -> AppResult<Arc<dyn DatabaseClient>>
Build the backend selected by DatabaseConfig::backend.
Trait Implementations§
Source§impl Default for DatabaseRegistry
impl Default for DatabaseRegistry
Source§fn default() -> DatabaseRegistry
fn default() -> DatabaseRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DatabaseRegistry
impl !UnwindSafe for DatabaseRegistry
impl Freeze for DatabaseRegistry
impl Send for DatabaseRegistry
impl Sync for DatabaseRegistry
impl Unpin for DatabaseRegistry
impl UnsafeUnpin for DatabaseRegistry
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