Skip to main content

Docker

Struct Docker 

Source
pub struct Docker { /* private fields */ }
Expand description

A Docker container: its image is built from a directory when it is not there, it runs detached, and it is removed when it stops. A database for the tests is one of these.

Implementations§

Source§

impl Docker

Source

pub fn new(name: &str, image: &str) -> Self

Source

pub fn container(self, name: &str) -> Self

The container’s name, which a stale one of the same name is removed by.

Source

pub fn build_from(self, dir: &str) -> Self

Where the image is built from, if it is not there.

Source

pub fn port(self, inside: u16, outside: u16) -> Self

Publishes the container’s inside port as outside on this machine.

Source

pub fn env(self, key: &str, value: &str) -> Self

Source

pub fn arg(self, arg: &str) -> Self

An argument for the image’s command, after the image.

Source

pub fn ready(self, ready: Ready) -> Self

Source

pub fn patience(self, patience: Duration) -> Self

Source

pub fn docker_program(self, program: &str) -> Self

Which program is Docker (for tests, and for podman).

Source

pub fn run_args(&self) -> Vec<String>

The arguments of docker run.

Source

pub fn build_args(&self) -> Option<Vec<String>>

The arguments of docker build, when there is a directory to build from.

Trait Implementations§

Source§

impl Clone for Docker

Source§

fn clone(&self) -> Docker

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Service for Docker

Source§

fn name(&self) -> &str

What the tests call it.
Source§

fn unavailable(&self) -> Option<String>

Why it cannot run on this machine, and how to get it so that it can; None when it can.
Source§

fn start(&self) -> Result<Box<dyn Running>, String>

Starts it and waits until it is ready.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.