[][src]Struct shiplift::Container

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

Interface for accessing and manipulating a docker container


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

pub fn new<S>(docker: &'a Docker, id: S) -> Self where
    S: Into<Cow<'a, str>>, 

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

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

Returns a top view of information about the container process

pub fn logs(
    opts: &LogsOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'a

Returns a stream of logs emitted but the container instance

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

Attaches a [TtyMultiplexer] to the container.

The [TtyMultiplexer] 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](TtyMultiplexer::split) method

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

Returns a set of changes made to the container instance

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

Exports the current docker container into a tarball

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

Returns a stream of stats specific to this container instance

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

Start the container instance

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

Stop the container instance

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

Restart the container instance

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

Kill the container instance

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

Rename the container instance

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

Pause the container instance

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

Unpause the container instance

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

Wait until the container stops

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

Delete the container instance

Use remove instead to use the force/v options.

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

Delete the container instance (todo: force/v)

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

pub fn copy_from(&self, path: &Path) -> impl Stream<Item = Result<Vec<u8>>> + 'a[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.

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

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.

Auto Trait Implementations

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

impl<'a> Send for Container<'a>

impl<'a> Sync for Container<'a>

impl<'a> Unpin for Container<'a>

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

Blanket Implementations

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

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

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

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

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.