Struct GCContainerRunner
pub struct GCContainerRunner {
config: GCContainerRunnerConfig,
}Expand description
Manages runtime containers via the podman CLI.
Fields§
§config: GCContainerRunnerConfigImplementations§
§impl GCContainerRunner
impl GCContainerRunner
pub fn builder(
hub_internal_port: u16,
config_path: PathBuf,
data_path: PathBuf,
) -> GCContainerRunnerBuilder
pub fn builder( hub_internal_port: u16, config_path: PathBuf, data_path: PathBuf, ) -> GCContainerRunnerBuilder
Returns a builder for configuring and constructing a GCContainerRunner.
§Arguments
hub_internal_port— port on which the service hub’s internal API listens; used to compute thehost.containers.internal:<port>address injected into containers.config_path— host directory mounted as/opt/gc_gateway/configinside containers.data_path— host directory mounted as/opt/gc_gateway/datainside containers.
async fn start_runtime(
&self,
runtime_id: &str,
host_network: bool,
) -> Result<(), ContainerRunnerError>
async fn start_runtime( &self, runtime_id: &str, host_network: bool, ) -> Result<(), ContainerRunnerError>
Ensures the gateway bridge network exists, then creates and starts the runtime container.
If host_network is true the container uses --network=host and gets
NET_RAW / NET_ADMIN capabilities for raw socket access.
async fn stop_runtime(
&self,
runtime_id: &str,
) -> Result<(), ContainerRunnerError>
async fn stop_runtime( &self, runtime_id: &str, ) -> Result<(), ContainerRunnerError>
Stops and removes the container for the given runtime ID.
pub(crate) async fn stop_all(&self) -> Result<(), ContainerRunnerError>
pub(crate) async fn stop_all(&self) -> Result<(), ContainerRunnerError>
Stops all containers carrying the managed label.
async fn ensure_network(&self, name: &str) -> Result<(), ContainerRunnerError>
async fn stop_container(&self, name: &str) -> Result<(), ContainerRunnerError>
async fn remove_container(&self, name: &str) -> Result<(), ContainerRunnerError>
Trait Implementations§
§impl Clone for GCContainerRunner
impl Clone for GCContainerRunner
§fn clone(&self) -> GCContainerRunner
fn clone(&self) -> GCContainerRunner
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for GCContainerRunner
impl Debug for GCContainerRunner
§impl RuntimeRunner for GCContainerRunner
impl RuntimeRunner for GCContainerRunner
§fn start<'a>(
&'a self,
runtime_id: &'a str,
host_network: bool,
) -> RunnerFuture<'a, Result<(), RunnerError>>
fn start<'a>( &'a self, runtime_id: &'a str, host_network: bool, ) -> RunnerFuture<'a, Result<(), RunnerError>>
Start the runtime with the given ID. Read more
§fn stop<'a>(
&'a self,
runtime_id: &'a str,
) -> RunnerFuture<'a, Result<(), RunnerError>>
fn stop<'a>( &'a self, runtime_id: &'a str, ) -> RunnerFuture<'a, Result<(), RunnerError>>
Stop (and clean up) the runtime with the given ID.
§fn fetch_local_runtimes<'a>(&'a self) -> RunnerFuture<'a, Vec<String>>
fn fetch_local_runtimes<'a>(&'a self) -> RunnerFuture<'a, Vec<String>>
Returns the IDs of all locally-running runtimes managed by this runner.
Auto Trait Implementations§
impl Freeze for GCContainerRunner
impl RefUnwindSafe for GCContainerRunner
impl Send for GCContainerRunner
impl Sync for GCContainerRunner
impl Unpin for GCContainerRunner
impl UnsafeUnpin for GCContainerRunner
impl UnwindSafe for GCContainerRunner
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