pub struct ContextCreateCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker context create command builder
Create a new Docker context.
§Example
use docker_wrapper::{ContextCreateCommand, DockerCommand};
// Create a context for a remote Docker daemon
ContextCreateCommand::new("production")
.description("Production environment")
.docker_host("ssh://user@remote-host")
.execute()
.await?;
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl ContextCreateCommand
impl ContextCreateCommand
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set context description
Sourcepub fn docker_host(self, host: impl Into<String>) -> Self
pub fn docker_host(self, host: impl Into<String>) -> Self
Set Docker host
Sourcepub fn default_stack_orchestrator(self, orchestrator: impl Into<String>) -> Self
pub fn default_stack_orchestrator(self, orchestrator: impl Into<String>) -> Self
Set default stack orchestrator (swarm|kubernetes|all)
Sourcepub fn docker_api_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn docker_api_endpoint(self, endpoint: impl Into<String>) -> Self
Set Docker API endpoint
Sourcepub fn kubernetes_config_file(self, file: impl Into<String>) -> Self
pub fn kubernetes_config_file(self, file: impl Into<String>) -> Self
Set Kubernetes config file
Sourcepub fn kubernetes_context(self, context: impl Into<String>) -> Self
pub fn kubernetes_context(self, context: impl Into<String>) -> Self
Set Kubernetes context
Sourcepub fn kubernetes_namespace(self, namespace: impl Into<String>) -> Self
pub fn kubernetes_namespace(self, namespace: impl Into<String>) -> Self
Set Kubernetes namespace
Sourcepub fn kubernetes_api_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn kubernetes_api_endpoint(self, endpoint: impl Into<String>) -> Self
Set Kubernetes API endpoint
Trait Implementations§
Source§impl Clone for ContextCreateCommand
impl Clone for ContextCreateCommand
Source§fn clone(&self) -> ContextCreateCommand
fn clone(&self) -> ContextCreateCommand
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 ContextCreateCommand
impl Debug for ContextCreateCommand
Source§impl DockerCommand for ContextCreateCommand
impl DockerCommand for ContextCreateCommand
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 ContextCreateCommand
impl RefUnwindSafe for ContextCreateCommand
impl Send for ContextCreateCommand
impl Sync for ContextCreateCommand
impl Unpin for ContextCreateCommand
impl UnwindSafe for ContextCreateCommand
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