pub struct DatabaseTemplate<B: DatabaseBackend + Clone + Send + 'static>{ /* private fields */ }
Expand description
A template database that can be used to create immutable copies
Implementations§
Source§impl<B: DatabaseBackend + Clone + Send + 'static> DatabaseTemplate<B>
impl<B: DatabaseBackend + Clone + Send + 'static> DatabaseTemplate<B>
Sourcepub async fn new(
backend: B,
config: PoolConfig,
max_replicas: usize,
) -> Result<Self>
pub async fn new( backend: B, config: PoolConfig, max_replicas: usize, ) -> Result<Self>
Create a new template database
Sourcepub async fn initialize_template<F, Fut>(&self, setup: F) -> Result<()>
pub async fn initialize_template<F, Fut>(&self, setup: F) -> Result<()>
Initialize the template database with a setup function
Sourcepub async fn get_immutable_database(&self) -> Result<ImmutableDatabase<'_, B>>
pub async fn get_immutable_database(&self) -> Result<ImmutableDatabase<'_, B>>
Get an immutable copy of the template database
Trait Implementations§
Source§impl<B: DatabaseBackend + Clone + Send + 'static> Clone for DatabaseTemplate<B>
impl<B: DatabaseBackend + Clone + Send + 'static> Clone for DatabaseTemplate<B>
Auto Trait Implementations§
impl<B> Freeze for DatabaseTemplate<B>
impl<B> !RefUnwindSafe for DatabaseTemplate<B>
impl<B> Send for DatabaseTemplate<B>
impl<B> Sync for DatabaseTemplate<B>
impl<B> Unpin for DatabaseTemplate<B>
impl<B> !UnwindSafe for DatabaseTemplate<B>
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