pub struct UnpauseCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker unpause command builder
Unpause all processes within one or more containers.
§Example
use docker_wrapper::UnpauseCommand;
// Unpause a single container
UnpauseCommand::new("my-container")
.run()
.await?;
// Unpause multiple containers
UnpauseCommand::new_multiple(vec!["web", "db", "cache"])
.run()
.await?;
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl UnpauseCommand
impl UnpauseCommand
Sourcepub fn new(container: impl Into<String>) -> Self
pub fn new(container: impl Into<String>) -> Self
Create a new unpause command for a single container
§Example
use docker_wrapper::UnpauseCommand;
let cmd = UnpauseCommand::new("my-container");
Sourcepub fn new_multiple(containers: Vec<impl Into<String>>) -> Self
pub fn new_multiple(containers: Vec<impl Into<String>>) -> Self
Create a new unpause command for multiple containers
§Example
use docker_wrapper::UnpauseCommand;
let cmd = UnpauseCommand::new_multiple(vec!["web", "db", "cache"]);
Sourcepub async fn run(&self) -> Result<UnpauseResult>
pub async fn run(&self) -> Result<UnpauseResult>
Execute the unpause command
§Errors
Returns an error if:
- The Docker daemon is not running
- Any of the specified containers don’t exist
- Any container is not paused
§Example
use docker_wrapper::UnpauseCommand;
let result = UnpauseCommand::new("my-container")
.run()
.await?;
if result.success() {
println!("Unpaused {} containers", result.unpaused_containers().len());
}
Trait Implementations§
Source§impl Clone for UnpauseCommand
impl Clone for UnpauseCommand
Source§fn clone(&self) -> UnpauseCommand
fn clone(&self) -> UnpauseCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for UnpauseCommand
impl Debug for UnpauseCommand
Source§impl DockerCommand for UnpauseCommand
impl DockerCommand for UnpauseCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The output type this command produces
Source§fn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Get the command executor for extensibility
Source§fn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Get mutable command executor for extensibility
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the complete command arguments including subcommands
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the command and return the typed output
Source§fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Helper method to execute the command with proper error handling
Source§fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
Add a raw argument to the command (escape hatch)
Auto Trait Implementations§
impl Freeze for UnpauseCommand
impl RefUnwindSafe for UnpauseCommand
impl Send for UnpauseCommand
impl Sync for UnpauseCommand
impl Unpin for UnpauseCommand
impl UnwindSafe for UnpauseCommand
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