pub struct SwarmInitCommand {
pub executor: CommandExecutor,
/* private fields */
}Expand description
Docker swarm init command builder
Fields§
§executor: CommandExecutorCommand executor
Implementations§
Source§impl SwarmInitCommand
impl SwarmInitCommand
Sourcepub fn advertise_addr(self, addr: impl Into<String>) -> Self
pub fn advertise_addr(self, addr: impl Into<String>) -> Self
Set the advertised address
Sourcepub fn availability(self, availability: impl Into<String>) -> Self
pub fn availability(self, availability: impl Into<String>) -> Self
Set the availability of the node
Sourcepub fn cert_expiry(self, expiry: impl Into<String>) -> Self
pub fn cert_expiry(self, expiry: impl Into<String>) -> Self
Set the certificate expiry duration
Sourcepub fn data_path_addr(self, addr: impl Into<String>) -> Self
pub fn data_path_addr(self, addr: impl Into<String>) -> Self
Set the data path address
Sourcepub fn data_path_port(self, port: u16) -> Self
pub fn data_path_port(self, port: u16) -> Self
Set the data path port
Sourcepub fn default_addr_pool(self, pool: impl Into<String>) -> Self
pub fn default_addr_pool(self, pool: impl Into<String>) -> Self
Add a default address pool
Sourcepub fn default_addr_pool_mask_length(self, length: u8) -> Self
pub fn default_addr_pool_mask_length(self, length: u8) -> Self
Set the default address pool mask length
Sourcepub fn dispatcher_heartbeat(self, heartbeat: impl Into<String>) -> Self
pub fn dispatcher_heartbeat(self, heartbeat: impl Into<String>) -> Self
Set the dispatcher heartbeat period
Sourcepub fn external_ca(self, url: impl Into<String>) -> Self
pub fn external_ca(self, url: impl Into<String>) -> Self
Set the external CA URL
Sourcepub fn force_new_cluster(self) -> Self
pub fn force_new_cluster(self) -> Self
Force create a new cluster from current state
Sourcepub fn listen_addr(self, addr: impl Into<String>) -> Self
pub fn listen_addr(self, addr: impl Into<String>) -> Self
Set the listen address
Sourcepub fn max_snapshots(self, count: u32) -> Self
pub fn max_snapshots(self, count: u32) -> Self
Set the maximum number of snapshots to keep
Sourcepub fn snapshot_interval(self, interval: u32) -> Self
pub fn snapshot_interval(self, interval: u32) -> Self
Set the snapshot interval
Sourcepub fn task_history_limit(self, limit: i32) -> Self
pub fn task_history_limit(self, limit: i32) -> Self
Set the task history retention limit
Trait Implementations§
Source§impl Clone for SwarmInitCommand
impl Clone for SwarmInitCommand
Source§fn clone(&self) -> SwarmInitCommand
fn clone(&self) -> SwarmInitCommand
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 SwarmInitCommand
impl Debug for SwarmInitCommand
Source§impl Default for SwarmInitCommand
impl Default for SwarmInitCommand
Source§fn default() -> SwarmInitCommand
fn default() -> SwarmInitCommand
Returns the “default value” for a type. Read more
Source§impl DockerCommand for SwarmInitCommand
impl DockerCommand for SwarmInitCommand
Source§type Output = SwarmInitResult
type Output = SwarmInitResult
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)
Source§fn args<I, S>(&mut self, args: I) -> &mut Self
fn args<I, S>(&mut self, args: I) -> &mut Self
Add multiple raw arguments to the command (escape hatch)
Source§fn option(&mut self, key: &str, value: &str) -> &mut Self
fn option(&mut self, key: &str, value: &str) -> &mut Self
Add a key-value option (e.g., –name value, –env key=value)
Source§fn with_timeout(&mut self, timeout: Duration) -> &mut Self
fn with_timeout(&mut self, timeout: Duration) -> &mut Self
Set a timeout for command execution Read more
Source§fn with_timeout_secs(&mut self, seconds: u64) -> &mut Self
fn with_timeout_secs(&mut self, seconds: u64) -> &mut Self
Set a timeout in seconds for command execution
Auto Trait Implementations§
impl Freeze for SwarmInitCommand
impl RefUnwindSafe for SwarmInitCommand
impl Send for SwarmInitCommand
impl Sync for SwarmInitCommand
impl Unpin for SwarmInitCommand
impl UnwindSafe for SwarmInitCommand
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