Skip to main content

RustyDocker

Struct RustyDocker 

Source
pub struct RustyDocker { /* private fields */ }
Expand description

Rusty Docker 服务

Implementations§

Source§

impl RustyDocker

Source

pub fn new() -> Result<Self>

创建新的 Rusty Docker 服务

Source

pub fn get_config(&self) -> Arc<DockerConfig>

获取全局配置

Source

pub fn reload_config(&mut self) -> Result<()>

重新加载配置

Source

pub async fn start(&self)

启动服务

Source

pub fn get_runtime(&self) -> Arc<ContainerRuntime>

获取容器运行时

Source

pub async fn run( &mut self, image: String, name: Option<String>, ports: Vec<String>, ) -> Result<ContainerInfo>

运行容器

Source

pub async fn list_containers(&self, all: bool) -> Result<Vec<ContainerInfo>>

列出容器

Source

pub async fn stop_container(&mut self, container_id: &str) -> Result<()>

停止容器

Source

pub async fn remove_container(&mut self, container_id: &str) -> Result<()>

删除容器

Source

pub fn clone(&self) -> Self

克隆 Docker 实例

Source

pub fn create_config( &self, name: &str, data: &str, labels: HashMap<String, String>, ) -> Result<ConfigInfo>

创建配置

Source

pub fn update_config( &self, config_id: &str, data: &str, labels: HashMap<String, String>, ) -> Result<ConfigInfo>

更新配置

Source

pub fn delete_config(&self, config_id: &str) -> Result<()>

删除配置

Source

pub fn get_config_info(&self, config_id: &str) -> Result<ConfigInfo>

获取配置详细信息

Source

pub fn list_configs(&self) -> Result<Vec<ConfigInfo>>

列出所有配置

Source

pub fn create_secret( &self, name: &str, data: &str, labels: HashMap<String, String>, ) -> Result<SecretInfo>

创建密钥

Source

pub fn delete_secret(&self, secret_id: &str) -> Result<()>

删除密钥

Source

pub fn get_secret_info(&self, secret_id: &str) -> Result<SecretInfo>

获取密钥详细信息

Source

pub fn list_secrets(&self) -> Result<Vec<SecretInfo>>

列出所有密钥

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.