pub struct Launcher { /* private fields */ }
Expand description
Base container command used for building and running containers.
This allows variations such as “docker”, “sudo docker”, and “podman”.
Implementations§
Source§impl Launcher
impl Launcher
Sourcepub fn new(base_command: Command) -> Self
pub fn new(base_command: Command) -> Self
Create a new Launcher
with the specified base Command
. The
base command is used to create all the other commands.
Sourcepub fn auto() -> Option<Self>
pub fn auto() -> Option<Self>
Automatically choose a base command.
- Chooses
podman
if is in the$PATH
. - Otherwise chooses
docker
if it is in the$PATH
.- If the current user is not in a
docker
group,sudo
is added.
- If the current user is not in a
If neither command is in the $PATH
, returns None
.
Sourcepub fn is_docker(&self) -> bool
pub fn is_docker(&self) -> bool
Whether the base command appears to be docker. This checks if the program or any of the arguments in the base command match “docker”.
Sourcepub fn is_podman(&self) -> bool
pub fn is_podman(&self) -> bool
Whether the base command appears to be podman. This checks if the program or any of the arguments in the base command match “podman”.
Sourcepub fn base_command(&self) -> &Command
pub fn base_command(&self) -> &Command
Get the base Command
.
Sourcepub fn create_network(&self, opt: CreateNetworkOpt) -> Command
pub fn create_network(&self, opt: CreateNetworkOpt) -> Command
Create a Command
for creating a network.
Sourcepub fn remove_network(&self, name: &str) -> Command
pub fn remove_network(&self, name: &str) -> Command
Create a Command
for removing a network.
Trait Implementations§
Source§impl From<BaseCommand> for Launcher
impl From<BaseCommand> for Launcher
Source§fn from(bc: BaseCommand) -> Launcher
fn from(bc: BaseCommand) -> Launcher
Converts to this type from the input type.
impl Eq for Launcher
impl StructuralPartialEq for Launcher
Auto Trait Implementations§
impl Freeze for Launcher
impl RefUnwindSafe for Launcher
impl Send for Launcher
impl Sync for Launcher
impl Unpin for Launcher
impl UnwindSafe for Launcher
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