pub struct ComposeConfig {
pub version: Option<String>,
pub services: HashMap<String, ServiceConfig>,
pub volumes: HashMap<String, Option<VolumeDeclaration>>,
pub networks: HashMap<String, Option<NetworkDeclaration>>,
}Expand description
Top-level compose file configuration.
Compatible with a subset of docker-compose v3 syntax:
version: "3"
services:
web:
image: nginx:latest
ports: ["8080:80"]
depends_on: [db]
db:
image: postgres:16
environment:
POSTGRES_PASSWORD: secret
volumes: ["pgdata:/var/lib/postgresql/data"]
volumes:
pgdata:
networks:
default:Fields§
§version: Option<String>Compose file version (informational, not enforced).
services: HashMap<String, ServiceConfig>Service definitions keyed by name.
volumes: HashMap<String, Option<VolumeDeclaration>>Named volume declarations (value is currently unused, reserved for driver options).
networks: HashMap<String, Option<NetworkDeclaration>>Named network declarations.
Implementations§
Source§impl ComposeConfig
impl ComposeConfig
Sourcepub fn from_yaml_str(yaml: &str) -> Result<Self, Error>
pub fn from_yaml_str(yaml: &str) -> Result<Self, Error>
Parse a compose config from a YAML string.
Trait Implementations§
Source§impl Clone for ComposeConfig
impl Clone for ComposeConfig
Source§fn clone(&self) -> ComposeConfig
fn clone(&self) -> ComposeConfig
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 moreSource§impl Debug for ComposeConfig
impl Debug for ComposeConfig
Source§impl<'de> Deserialize<'de> for ComposeConfig
impl<'de> Deserialize<'de> for ComposeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ComposeConfig
impl RefUnwindSafe for ComposeConfig
impl Send for ComposeConfig
impl Sync for ComposeConfig
impl Unpin for ComposeConfig
impl UnsafeUnpin for ComposeConfig
impl UnwindSafe for ComposeConfig
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