pub struct RustyDocker { /* private fields */ }Expand description
Rusty Docker 服务
Implementations§
Source§impl RustyDocker
impl RustyDocker
Sourcepub fn get_config(&self) -> Arc<DockerConfig>
pub fn get_config(&self) -> Arc<DockerConfig>
获取全局配置
Sourcepub fn reload_config(&mut self) -> Result<()>
pub fn reload_config(&mut self) -> Result<()>
重新加载配置
Sourcepub fn get_runtime(&self) -> Arc<ContainerRuntime>
pub fn get_runtime(&self) -> Arc<ContainerRuntime>
获取容器运行时
Sourcepub async fn run(
&mut self,
image: String,
name: Option<String>,
ports: Vec<String>,
) -> Result<ContainerInfo>
pub async fn run( &mut 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 stop_container(&mut self, container_id: &str) -> Result<()>
pub async fn stop_container(&mut self, container_id: &str) -> Result<()>
停止容器
Sourcepub async fn remove_container(&mut self, container_id: &str) -> Result<()>
pub async fn remove_container(&mut self, container_id: &str) -> Result<()>
删除容器
Sourcepub fn create_config(
&self,
name: &str,
data: &str,
labels: HashMap<String, String>,
) -> Result<ConfigInfo>
pub fn create_config( &self, name: &str, data: &str, labels: HashMap<String, String>, ) -> Result<ConfigInfo>
创建配置
Sourcepub fn update_config(
&self,
config_id: &str,
data: &str,
labels: HashMap<String, String>,
) -> Result<ConfigInfo>
pub fn update_config( &self, config_id: &str, data: &str, labels: HashMap<String, String>, ) -> Result<ConfigInfo>
更新配置
Sourcepub fn delete_config(&self, config_id: &str) -> Result<()>
pub fn delete_config(&self, config_id: &str) -> Result<()>
删除配置
Sourcepub fn get_config_info(&self, config_id: &str) -> Result<ConfigInfo>
pub fn get_config_info(&self, config_id: &str) -> Result<ConfigInfo>
获取配置详细信息
Sourcepub fn list_configs(&self) -> Result<Vec<ConfigInfo>>
pub fn list_configs(&self) -> Result<Vec<ConfigInfo>>
列出所有配置
Sourcepub fn create_secret(
&self,
name: &str,
data: &str,
labels: HashMap<String, String>,
) -> Result<SecretInfo>
pub fn create_secret( &self, name: &str, data: &str, labels: HashMap<String, String>, ) -> Result<SecretInfo>
创建密钥
Sourcepub fn delete_secret(&self, secret_id: &str) -> Result<()>
pub fn delete_secret(&self, secret_id: &str) -> Result<()>
删除密钥
Sourcepub fn get_secret_info(&self, secret_id: &str) -> Result<SecretInfo>
pub fn get_secret_info(&self, secret_id: &str) -> Result<SecretInfo>
获取密钥详细信息
Sourcepub fn list_secrets(&self) -> Result<Vec<SecretInfo>>
pub fn list_secrets(&self) -> Result<Vec<SecretInfo>>
列出所有密钥
Auto Trait Implementations§
impl Freeze for RustyDocker
impl !RefUnwindSafe for RustyDocker
impl Send for RustyDocker
impl Sync for RustyDocker
impl Unpin for RustyDocker
impl UnsafeUnpin for RustyDocker
impl !UnwindSafe for RustyDocker
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