pub struct RestartCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker restart command builder with fluent API
Fields§
§executor: CommandExecutor
Command executor for extensibility
Implementations§
Source§impl RestartCommand
impl RestartCommand
Sourcepub fn new(container: impl Into<String>) -> Self
pub fn new(container: impl Into<String>) -> Self
Create a new restart command for the specified container(s)
§Examples
use docker_wrapper::RestartCommand;
let cmd = RestartCommand::new("my-container");
use docker_wrapper::RestartCommand;
let cmd = RestartCommand::new_multiple(vec!["container1", "container2"]);
Sourcepub fn new_multiple<I, S>(containers: I) -> Self
pub fn new_multiple<I, S>(containers: I) -> Self
Create a new restart command for multiple containers
§Examples
use docker_wrapper::RestartCommand;
let cmd = RestartCommand::new_multiple(vec!["container1", "container2"]);
Sourcepub fn signal(self, signal: impl Into<String>) -> Self
pub fn signal(self, signal: impl Into<String>) -> Self
Set the signal to send to the container
§Examples
use docker_wrapper::RestartCommand;
let cmd = RestartCommand::new("my-container")
.signal("SIGTERM");
Sourcepub fn timeout(self, timeout: u32) -> Self
pub fn timeout(self, timeout: u32) -> Self
Set the timeout in seconds to wait before killing the container
§Examples
use docker_wrapper::RestartCommand;
let cmd = RestartCommand::new("my-container")
.timeout(30);
Sourcepub fn timeout_duration(self, timeout: Duration) -> Self
pub fn timeout_duration(self, timeout: Duration) -> Self
Set the timeout using a Duration
§Examples
use docker_wrapper::RestartCommand;
use std::time::Duration;
let cmd = RestartCommand::new("my-container")
.timeout_duration(Duration::from_secs(30));
Trait Implementations§
Source§impl Clone for RestartCommand
impl Clone for RestartCommand
Source§fn clone(&self) -> RestartCommand
fn clone(&self) -> RestartCommand
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 RestartCommand
impl Debug for RestartCommand
Source§impl DockerCommand for RestartCommand
impl DockerCommand for RestartCommand
Source§type Output = RestartResult
type Output = RestartResult
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 RestartCommand
impl RefUnwindSafe for RestartCommand
impl Send for RestartCommand
impl Sync for RestartCommand
impl Unpin for RestartCommand
impl UnwindSafe for RestartCommand
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