pub struct NetworkCreateCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker network create command builder
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl NetworkCreateCommand
impl NetworkCreateCommand
Sourcepub fn driver(self, driver: impl Into<String>) -> Self
pub fn driver(self, driver: impl Into<String>) -> Self
Set the network driver (bridge, overlay, macvlan, none, etc.)
Sourcepub fn driver_opt(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn driver_opt( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a driver specific option
Sourcepub fn attachable(self) -> Self
pub fn attachable(self) -> Self
Enable manual container attachment
Sourcepub fn label(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn label(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a network label
Sourcepub fn config_from(self, network: impl Into<String>) -> Self
pub fn config_from(self, network: impl Into<String>) -> Self
Create network from existing config
Sourcepub fn config_only(self) -> Self
pub fn config_only(self) -> Self
Config only (don’t create network)
Sourcepub fn aux_address(self, name: impl Into<String>, ip: impl Into<String>) -> Self
pub fn aux_address(self, name: impl Into<String>, ip: impl Into<String>) -> Self
Add auxiliary address
Sourcepub async fn run(&self) -> Result<NetworkCreateResult>
pub async fn run(&self) -> Result<NetworkCreateResult>
Execute the command
§Errors
Returns an error if the Docker daemon is not running or the command fails
Trait Implementations§
Source§impl Clone for NetworkCreateCommand
impl Clone for NetworkCreateCommand
Source§fn clone(&self) -> NetworkCreateCommand
fn clone(&self) -> NetworkCreateCommand
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 NetworkCreateCommand
impl Debug for NetworkCreateCommand
Source§impl DockerCommand for NetworkCreateCommand
impl DockerCommand for NetworkCreateCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The output type this command produces
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the complete command arguments including subcommands
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 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 NetworkCreateCommand
impl RefUnwindSafe for NetworkCreateCommand
impl Send for NetworkCreateCommand
impl Sync for NetworkCreateCommand
impl Unpin for NetworkCreateCommand
impl UnwindSafe for NetworkCreateCommand
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