Struct shiplift::container::Container[][src]

pub struct Container<'docker> { /* fields omitted */ }

Interface for accessing and manipulating a docker container

Api Reference

Implementations

impl<'docker> Container<'docker>[src]

pub fn new<S>(docker: &'docker Docker, id: S) -> Self where
    S: Into<String>, 
[src]

Exports an interface exposing operations against a container instance

pub fn id(&self) -> &str[src]

a getter for the container id

pub async fn inspect(&self) -> Result<ContainerDetails>[src]

Inspects the current docker container instance’s details

Api Reference

pub async fn top(&self, psargs: Option<&str>) -> Result<Top>[src]

Returns a top view of information about the container process

Api Reference

pub fn logs(
    &self,
    opts: &LogsOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'docker
[src]

Returns a stream of logs emitted but the container instance

Api Reference

pub async fn attach(&self) -> Result<TtyMultiPlexer<'docker>>[src]

Attaches a Multiplexer to the container.

The Multiplexer implements Stream for returning Stdout and Stderr chunks. It also implements [AsyncWrite] for writing to Stdin.

The multiplexer can be split into its read and write halves with the split method

Api Reference

pub async fn changes(&self) -> Result<Vec<Change>>[src]

Returns a set of changes made to the container instance

Api Reference

pub fn export(&self) -> impl Stream<Item = Result<Vec<u8>>> + 'docker[src]

Exports the current docker container into a tarball

Api Reference

pub fn stats(&self) -> impl Stream<Item = Result<Stats>> + Unpin + 'docker[src]

Returns a stream of stats specific to this container instance

Api Reference

pub async fn start(&self) -> Result<()>[src]

Start the container instance

Api Reference

pub async fn stop(&self, wait: Option<Duration>) -> Result<()>[src]

Stop the container instance

Api Reference

pub async fn restart(&self, wait: Option<Duration>) -> Result<()>[src]

Restart the container instance

Api Reference

pub async fn kill(&self, signal: Option<&str>) -> Result<()>[src]

Kill the container instance

Api Reference

pub async fn rename(&self, name: &str) -> Result<()>[src]

Rename the container instance

Api Reference

pub async fn pause(&self) -> Result<()>[src]

Pause the container instance

Api Reference

pub async fn unpause(&self) -> Result<()>[src]

Unpause the container instance

Api Reference

pub async fn wait(&self) -> Result<Exit>[src]

Wait until the container stops

Api Reference

pub async fn delete(&self) -> Result<()>[src]

Delete the container instance

Use remove instead to use the force/v options.

Api Reference

pub async fn remove(&self, opts: RmContainerOptions) -> Result<()>[src]

Delete the container instance (todo: force/v)

Api Reference

pub fn exec(
    &self,
    opts: &ExecContainerOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'docker
[src]

Execute a command in this container

Api Reference

pub fn copy_from(
    &self,
    path: &Path
) -> impl Stream<Item = Result<Vec<u8>>> + 'docker
[src]

Copy a file/folder from the container. The resulting stream is a tarball of the extracted files.

If path is not an absolute path, it is relative to the container’s root directory. The resource specified by path must exist. To assert that the resource is expected to be a directory, path should end in / or /. (assuming a path separator of /). If path ends in /. then this indicates that only the contents of the path directory should be copied. A symlink is always resolved to its target.

Api Reference

pub async fn copy_file_into<P: AsRef<Path>>(
    &self,
    path: P,
    bytes: &[u8]
) -> Result<()>
[src]

Copy a byte slice as file into (see bytes) the container.

The file will be copied at the given location (see path) and will be owned by root with access mask 644.

Api Reference

pub async fn copy_to(&self, path: &Path, body: Body) -> Result<()>[src]

Copy a tarball (see body) to the container.

The tarball will be copied to the container and extracted at the given location (see path).

Api Reference

Auto Trait Implementations

impl<'docker> !RefUnwindSafe for Container<'docker>

impl<'docker> Send for Container<'docker>

impl<'docker> Sync for Container<'docker>

impl<'docker> Unpin for Container<'docker>

impl<'docker> !UnwindSafe for Container<'docker>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.