pub struct DockerManager { /* private fields */ }Expand description
Docker manager
Implementations§
Source§impl DockerManager
impl DockerManager
pub fn new() -> Self
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if Docker is available
Sourcepub fn get_containers(&self) -> &[ContainerInfo]
pub fn get_containers(&self) -> &[ContainerInfo]
Get all containers
Sourcepub fn get_running(&self) -> Vec<&ContainerInfo>
pub fn get_running(&self) -> Vec<&ContainerInfo>
Get running containers
Sourcepub fn total_memory_mb(&self) -> f64
pub fn total_memory_mb(&self) -> f64
Get total memory usage
Sourcepub fn get_idle_containers(&self) -> Vec<&ContainerInfo>
pub fn get_idle_containers(&self) -> Vec<&ContainerInfo>
Get idle containers (running but low CPU)
Sourcepub fn pause_container(&self, id: &str) -> OptimizationResult
pub fn pause_container(&self, id: &str) -> OptimizationResult
Pause a container
Sourcepub fn unpause_container(&self, id: &str) -> OptimizationResult
pub fn unpause_container(&self, id: &str) -> OptimizationResult
Unpause a container
Sourcepub fn stop_container(&self, id: &str) -> OptimizationResult
pub fn stop_container(&self, id: &str) -> OptimizationResult
Stop a container
Sourcepub fn get_suggestions(&self) -> Vec<(String, OptimizationAction, String)>
pub fn get_suggestions(&self) -> Vec<(String, OptimizationAction, String)>
Get optimization suggestions
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print container summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DockerManager
impl RefUnwindSafe for DockerManager
impl Send for DockerManager
impl Sync for DockerManager
impl Unpin for DockerManager
impl UnwindSafe for DockerManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more