[−][src]Struct dockers::containers::Container
Container
Container struct that implement several methods for handling containers.
You have multiple ways to create a container.
extern crate dockers; use dockers::Container; // From the struct let cont = Container { Image: "debian".to_owned(), ..Default::default() } .create(Some("my_container_name".to_owned()), None) .expect("Cannot create container for debian"); // You could clone a container! // TODO cont.remove().unwrap();
Fields
Id: String
Names: Vec<String>
Image: String
ImageID: String
Command: String
State: String
Status: String
Ports: Vec<Port>
Labels: Option<HashMap<String, Value>>
SizeRw: Option<i64>
SizeRootFs: u64
HostConfig: HostConfig
Mounts: Vec<Mounts>
Methods
impl Container
[src]
pub fn new(Id: Option<String>, Image: Option<String>) -> Container
[src]
pub fn create(
&self,
name: Option<String>,
config: Option<ContainerConfig>
) -> Result<Container, DockerApiError>
[src]
&self,
name: Option<String>,
config: Option<ContainerConfig>
) -> Result<Container, DockerApiError>
pub fn list() -> Result<Vec<Container>, DockerApiError>
[src]
pub fn start(&self) -> Result<String, DockerApiError>
[src]
pub fn stop(&self) -> Result<String, DockerApiError>
[src]
pub fn restart(&self) -> Result<String, DockerApiError>
[src]
pub fn kill(&self) -> Result<String, DockerApiError>
[src]
pub fn pause(&self) -> Result<String, DockerApiError>
[src]
pub fn unpause(&self) -> Result<String, DockerApiError>
[src]
pub fn remove(self) -> Result<String, DockerApiError>
[src]
Trait Implementations
impl Client for Container
[src]
fn get_response_from_api(
&self,
api_endpoint: &str,
method: Method,
query_params: Option<&str>,
body: Option<&str>
) -> Result<Response, DockerApiError>
[src]
&self,
api_endpoint: &str,
method: Method,
query_params: Option<&str>,
body: Option<&str>
) -> Result<Response, DockerApiError>
impl Default for Container
[src]
impl Debug for Container
[src]
impl Serialize for Container
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Container where
Container: Default,
[src]
Container: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,