Struct shiplift::container::Container [−][src]
pub struct Container<'docker> { /* fields omitted */ }
Interface for accessing and manipulating a docker container
Implementations
impl<'docker> Container<'docker>
[src]
impl<'docker> Container<'docker>
[src]pub fn new<S>(docker: &'docker Docker, id: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
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(
&self,
opts: &LogsOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'docker
[src]
&self,
opts: &LogsOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'docker
Returns a stream of logs emitted but the container instance
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
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>>> + 'docker
[src]
Exports the current docker container into a tarball
pub fn stats(&self) -> impl Stream<Item = Result<Stats>> + Unpin + 'docker
[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]
pub async fn remove(&self, opts: RmContainerOptions) -> Result<()>
[src]
Delete the container instance (todo: force/v)
pub fn exec(
&self,
opts: &ExecContainerOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'docker
[src]
&self,
opts: &ExecContainerOptions
) -> impl Stream<Item = Result<TtyChunk>> + Unpin + 'docker
Execute a command in this container
pub fn copy_from(
&self,
path: &Path
) -> impl Stream<Item = Result<Vec<u8>>> + 'docker
[src]
&self,
path: &Path
) -> impl Stream<Item = Result<Vec<u8>>> + 'docker
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<()>
[src]
&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.
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
).
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> Instrument for T
[src]
impl<T> Instrument for T
[src]