pub struct Configurator { /* private fields */ }
Expand description
Configuration of the container
Implementations§
Source§impl Configurator
impl Configurator
Sourcepub fn set_command(
self,
command: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn set_command( self, command: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set the command for the docker
Sourcepub fn set_capture_stdio(self, capture: bool) -> Self
pub fn set_capture_stdio(self, capture: bool) -> Self
Capture stdin/err/out
Sourcepub fn set_interactive(self, interactive: bool) -> Self
pub fn set_interactive(self, interactive: bool) -> Self
Set the docker in interactive mode.
Sourcepub fn set_privilged(self, privileged: bool) -> Self
👎Deprecated since 0.2.4: please use set_privileged
instead
pub fn set_privilged(self, privileged: bool) -> Self
set_privileged
insteadEnable/disable privileged (see docker documentation).
Sourcepub fn set_privileged(self, privileged: bool) -> Self
pub fn set_privileged(self, privileged: bool) -> Self
Enable/disable privileged (see docker documentation).
Sourcepub fn set_x11_forwarding(self, x11_forwarding: bool) -> Self
pub fn set_x11_forwarding(self, x11_forwarding: bool) -> Self
Forward X11 to the container
Sourcepub fn set_network(self, network: Network) -> Self
pub fn set_network(self, network: Network) -> Self
Set the network mode
Sourcepub fn mount(
self,
host_dir: impl Into<String>,
container_dir: impl Into<String>,
) -> Self
pub fn mount( self, host_dir: impl Into<String>, container_dir: impl Into<String>, ) -> Self
Mount a drive from the host to the container
Sourcepub fn set_username(self, username: impl Into<String>) -> Self
pub fn set_username(self, username: impl Into<String>) -> Self
Set the username in the container, this is required for X11 forwarding
Sourcepub fn set_env_variable(
self,
name: impl Into<String>,
variable: impl Into<String>,
) -> Self
pub fn set_env_variable( self, name: impl Into<String>, variable: impl Into<String>, ) -> Self
Set an environment variable
Sourcepub fn set_clean_up(self, clean_up: bool) -> Self
pub fn set_clean_up(self, clean_up: bool) -> Self
Set if the container should be cleaned up after execution (set –rm)
Sourcepub fn generate_name(self, prefix: impl Into<String>) -> Self
pub fn generate_name(self, prefix: impl Into<String>) -> Self
generate a name with the given prefix
Sourcepub fn map_port(self, host_port: u16, container_port: u16) -> Self
pub fn map_port(self, host_port: u16, container_port: u16) -> Self
Map a host port to a container port
Sourcepub fn cond(self, cond: bool, f: impl FnOnce(Self) -> Self) -> Self
pub fn cond(self, cond: bool, f: impl FnOnce(Self) -> Self) -> Self
Convenience function for configuring the container with a condition.
If cond
is true, the closure f
is executed.
Auto Trait Implementations§
impl Freeze for Configurator
impl RefUnwindSafe for Configurator
impl Send for Configurator
impl Sync for Configurator
impl Unpin for Configurator
impl UnwindSafe for Configurator
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