pub struct ComposeProject {
pub name: String,
pub config: ComposeConfig,
pub service_order: Vec<String>,
pub service_boxes: HashMap<String, String>,
pub networks: Vec<String>,
pub base_dir: PathBuf,
}Expand description
A running compose project.
Fields§
§name: StringProject name (derived from directory name or –project-name).
config: ComposeConfigThe parsed compose config.
service_order: Vec<String>Service boot order (topologically sorted).
service_boxes: HashMap<String, String>Map of service name → box ID (once started).
networks: Vec<String>Networks created for this project.
base_dir: PathBufBase directory used to resolve relative env_file paths.
Implementations§
Source§impl ComposeProject
impl ComposeProject
Sourcepub fn new(name: impl Into<String>, config: ComposeConfig) -> Result<Self>
pub fn new(name: impl Into<String>, config: ComposeConfig) -> Result<Self>
Create a new compose project from a config.
Validates the config and computes the service boot order.
Sourcepub fn with_base_dir(
name: impl Into<String>,
config: ComposeConfig,
base_dir: impl Into<PathBuf>,
) -> Result<Self>
pub fn with_base_dir( name: impl Into<String>, config: ComposeConfig, base_dir: impl Into<PathBuf>, ) -> Result<Self>
Create a compose project with an explicit base directory.
Sourcepub fn state(&self) -> ProjectState
pub fn state(&self) -> ProjectState
Get the project state based on which services have box IDs.
Sourcepub fn build_box_config(
&self,
service_name: &str,
default_network: Option<&str>,
) -> Result<BoxConfig>
pub fn build_box_config( &self, service_name: &str, default_network: Option<&str>, ) -> Result<BoxConfig>
Build a BoxConfig for a single service.
Translates compose service fields into the BoxConfig used by VmManager.
Sourcepub fn default_network_name(&self) -> String
pub fn default_network_name(&self) -> String
Get the network name for this project’s default network.
Sourcepub fn required_networks(&self) -> Vec<String>
pub fn required_networks(&self) -> Vec<String>
Get all network names this project needs (project-prefixed).
Sourcepub fn register_service(&mut self, service_name: &str, box_id: String)
pub fn register_service(&mut self, service_name: &str, box_id: String)
Record that a service has been started with the given box ID.
Sourcepub fn unregister_service(&mut self, service_name: &str)
pub fn unregister_service(&mut self, service_name: &str)
Remove a service’s box ID (on stop/destroy).
Sourcepub fn box_id(&self, service_name: &str) -> Option<&str>
pub fn box_id(&self, service_name: &str) -> Option<&str>
Get the box ID for a service, if running.
Sourcepub fn shutdown_order(&self) -> Vec<String>
pub fn shutdown_order(&self) -> Vec<String>
Get the shutdown order (reverse of boot order).
Sourcepub fn health_wait_deps(&self, service_name: &str) -> Vec<String>
pub fn health_wait_deps(&self, service_name: &str) -> Vec<String>
Check if a service requires its dependencies to be healthy before starting.
Returns the list of dependency service names that must reach “healthy” status.
Sourcepub fn completed_wait_deps(&self, service_name: &str) -> Vec<String>
pub fn completed_wait_deps(&self, service_name: &str) -> Vec<String>
Dependencies this service must wait to run to completion (exit 0) before
starting — depends_on: { dep: { condition: service_completed_successfully } }.
Sourcepub fn healthcheck(&self, service_name: &str) -> Option<HealthCheckSpec>
pub fn healthcheck(&self, service_name: &str) -> Option<HealthCheckSpec>
Get the health check config for a service, if defined.
Sourcepub fn healthcheck_disabled(&self, service_name: &str) -> bool
pub fn healthcheck_disabled(&self, service_name: &str) -> bool
Return true when a service explicitly disables its health check.
Trait Implementations§
Source§impl Clone for ComposeProject
impl Clone for ComposeProject
Source§fn clone(&self) -> ComposeProject
fn clone(&self) -> ComposeProject
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ComposeProject
impl RefUnwindSafe for ComposeProject
impl Send for ComposeProject
impl Sync for ComposeProject
impl Unpin for ComposeProject
impl UnsafeUnpin for ComposeProject
impl UnwindSafe for ComposeProject
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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