pub struct MongodbTemplate { /* private fields */ }
Expand description
MongoDB container template with sensible defaults
Implementations§
Source§impl MongodbTemplate
impl MongodbTemplate
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a new MongoDB template with default settings
Sourcepub fn root_username(self, username: impl Into<String>) -> Self
pub fn root_username(self, username: impl Into<String>) -> Self
Set root username
Sourcepub fn root_password(self, password: impl Into<String>) -> Self
pub fn root_password(self, password: impl Into<String>) -> Self
Set root password
Sourcepub fn with_persistence(self, volume_name: impl Into<String>) -> Self
pub fn with_persistence(self, volume_name: impl Into<String>) -> Self
Enable persistence with a volume
Sourcepub fn init_scripts(self, scripts_path: impl Into<String>) -> Self
pub fn init_scripts(self, scripts_path: impl Into<String>) -> Self
Mount initialization scripts directory
Sourcepub fn config_file(self, config_path: impl Into<String>) -> Self
pub fn config_file(self, config_path: impl Into<String>) -> Self
Mount custom MongoDB configuration
Sourcepub fn memory_limit(self, limit: impl Into<String>) -> Self
pub fn memory_limit(self, limit: impl Into<String>) -> Self
Set memory limit for MongoDB
Sourcepub fn cache_size(self, size: impl Into<String>) -> Self
pub fn cache_size(self, size: impl Into<String>) -> Self
Set WiredTiger cache size
Sourcepub fn replica_set(self, name: impl Into<String>) -> Self
pub fn replica_set(self, name: impl Into<String>) -> Self
Enable replica set mode
Sourcepub fn auto_remove(self) -> Self
pub fn auto_remove(self) -> Self
Enable auto-remove when stopped
Sourcepub fn journal_commit_interval(self, ms: u32) -> Self
pub fn journal_commit_interval(self, ms: u32) -> Self
Set journal commit interval
Trait Implementations§
Source§impl Template for MongodbTemplate
impl Template for MongodbTemplate
Source§fn config(&self) -> &TemplateConfig
fn config(&self) -> &TemplateConfig
Get the template configuration
Source§fn config_mut(&mut self) -> &mut TemplateConfig
fn config_mut(&mut self) -> &mut TemplateConfig
Get a mutable reference to the configuration
Source§fn build_command(&self) -> RunCommand
fn build_command(&self) -> RunCommand
Build the RunCommand for this template
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the container with this template
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the container
Source§fn remove<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove the container
Source§fn is_running<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_running<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the container is running
Auto Trait Implementations§
impl Freeze for MongodbTemplate
impl RefUnwindSafe for MongodbTemplate
impl Send for MongodbTemplate
impl Sync for MongodbTemplate
impl Unpin for MongodbTemplate
impl UnwindSafe for MongodbTemplate
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