pub struct ContainerRuntime { /* private fields */ }Expand description
容器运行时
Implementations§
Source§impl ContainerRuntime
impl ContainerRuntime
Sourcepub fn new_with_config(config: Arc<DockerConfig>) -> Result<Self>
pub fn new_with_config(config: Arc<DockerConfig>) -> Result<Self>
使用配置创建新的容器运行时
Sourcepub fn get_config(&self) -> Arc<DockerConfig>
pub fn get_config(&self) -> Arc<DockerConfig>
获取配置
Sourcepub async fn create_container(
&self,
config: ContainerConfig,
) -> Result<ContainerInfo>
pub async fn create_container( &self, config: ContainerConfig, ) -> Result<ContainerInfo>
创建容器
Sourcepub async fn start_container(&self, container_id: &str) -> Result<()>
pub async fn start_container(&self, container_id: &str) -> Result<()>
启动容器
Sourcepub async fn stop_container(&self, container_id: &str) -> Result<()>
pub async fn stop_container(&self, container_id: &str) -> Result<()>
停止容器
Sourcepub async fn run_container(
&self,
image: String,
name: Option<String>,
_ports: Vec<String>,
) -> Result<ContainerInfo>
pub async fn run_container( &self, image: String, name: Option<String>, _ports: Vec<String>, ) -> Result<ContainerInfo>
运行容器
Sourcepub async fn list_containers(&self, all: bool) -> Result<Vec<ContainerInfo>>
pub async fn list_containers(&self, all: bool) -> Result<Vec<ContainerInfo>>
列出容器
Sourcepub async fn remove_container(&self, container_id: &str) -> Result<()>
pub async fn remove_container(&self, container_id: &str) -> Result<()>
删除容器
Auto Trait Implementations§
impl Freeze for ContainerRuntime
impl !RefUnwindSafe for ContainerRuntime
impl Send for ContainerRuntime
impl Sync for ContainerRuntime
impl Unpin for ContainerRuntime
impl UnsafeUnpin for ContainerRuntime
impl !UnwindSafe for ContainerRuntime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more