summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authordoug tangren <d.tangren@gmail.com>2016-07-06 08:28:44 -0400
committerGitHub <noreply@github.com>2016-07-06 08:28:44 -0400
commit9178b43adb6e6d0ccd41efdd1993555e3db80068 (patch)
treebbe7b57a9cb5da76e2da5a956908355158664b23 /src/lib.rs
parent56cad3d908632665da6a22f647212c335360d02e (diff)
parent1688d3c44b7b898e67a0224337b777546fc77fb2 (diff)
Merge pull request #17 from gregwebs/get-container-id
add a getter for the container id
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9a8c436..097bee1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -262,6 +262,9 @@ impl<'a, 'b> Container<'a, 'b> {
}
}
+ /// a getter for the container id
+ pub fn id(&self) -> &str { &self.id }
+
/// Inspects the current docker container instance's details
pub fn inspect(&self) -> Result<ContainerDetails> {
let raw = try!(self.docker.get(&format!("/containers/{}/json", self.id)[..]));