pub struct StartCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker start command builder with fluent API
Fields§
§executor: CommandExecutor
Command executor for extensibility
Implementations§
Source§impl StartCommand
impl StartCommand
Sourcepub fn new(container: impl Into<String>) -> Self
pub fn new(container: impl Into<String>) -> Self
Create a new start command for the specified container(s)
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new("my-container");
use docker_wrapper::StartCommand;
let cmd = StartCommand::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 start command for multiple containers
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new_multiple(vec!["container1", "container2"]);
Sourcepub fn attach(self) -> Self
pub fn attach(self) -> Self
Attach STDOUT/STDERR and forward signals
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new("my-container")
.attach();
Sourcepub fn checkpoint(self, checkpoint: impl Into<String>) -> Self
pub fn checkpoint(self, checkpoint: impl Into<String>) -> Self
Restore from this checkpoint
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new("my-container")
.checkpoint("checkpoint1");
Sourcepub fn checkpoint_dir(self, dir: impl Into<String>) -> Self
pub fn checkpoint_dir(self, dir: impl Into<String>) -> Self
Use a custom checkpoint storage directory
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new("my-container")
.checkpoint_dir("/custom/checkpoint/dir");
Sourcepub fn detach_keys(self, keys: impl Into<String>) -> Self
pub fn detach_keys(self, keys: impl Into<String>) -> Self
Override the key sequence for detaching a container
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new("my-container")
.detach_keys("ctrl-p,ctrl-q");
Sourcepub fn interactive(self) -> Self
pub fn interactive(self) -> Self
Attach container’s STDIN
§Examples
use docker_wrapper::StartCommand;
let cmd = StartCommand::new("my-container")
.interactive();
Trait Implementations§
Source§impl Clone for StartCommand
impl Clone for StartCommand
Source§fn clone(&self) -> StartCommand
fn clone(&self) -> StartCommand
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 StartCommand
impl Debug for StartCommand
Source§impl DockerCommand for StartCommand
impl DockerCommand for StartCommand
Source§type Output = StartResult
type Output = StartResult
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 StartCommand
impl RefUnwindSafe for StartCommand
impl Send for StartCommand
impl Sync for StartCommand
impl Unpin for StartCommand
impl UnwindSafe for StartCommand
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