pub struct StorageRegistry { /* private fields */ }Implementations§
Source§impl StorageRegistry
impl StorageRegistry
Sourcepub async fn get_or_init<T: StorageProviderPool, F, Fut, E>(
&self,
init: F,
) -> Result<Arc<T>, E>
pub async fn get_or_init<T: StorageProviderPool, F, Fut, E>( &self, init: F, ) -> Result<Arc<T>, E>
Lazily initializes a global shared resource. If the resource already exists, it is returned immediately. This allows multiple plugins to safely share a single connection pool without requiring manual initialization in main.rs.
Trait Implementations§
Source§impl Default for StorageRegistry
impl Default for StorageRegistry
Source§fn default() -> StorageRegistry
fn default() -> StorageRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for StorageRegistry
impl !RefUnwindSafe for StorageRegistry
impl !UnwindSafe for StorageRegistry
impl Send for StorageRegistry
impl Sync for StorageRegistry
impl Unpin for StorageRegistry
impl UnsafeUnpin for StorageRegistry
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