pub struct File {
pub version: String,
pub services: BTreeMap<String, Service>,
pub volumes: BTreeMap<String, Volume>,
pub networks: BTreeMap<String, Network>,
/* private fields */
}Expand description
A docker-compose.yml file.
Fields§
§version: StringThe version of the docker-compose.yml file format. Must be 2.
services: BTreeMap<String, Service>The individual services which make up this app.
volumes: BTreeMap<String, Volume>Named volumes used by this app.
TODO MED: Can we parse just volume names followed by a colon?
networks: BTreeMap<String, Network>The networks used by this app.
Implementations§
Source§impl File
impl File
Sourcepub fn read<R>(r: R) -> Result<Self>where
R: Read,
pub fn read<R>(r: R) -> Result<Self>where
R: Read,
Read a file from an input stream containing YAML.
Sourcepub fn write<W>(&self, w: &mut W) -> Result<()>where
W: Write,
pub fn write<W>(&self, w: &mut W) -> Result<()>where
W: Write,
Write a file to an output stream as YAML.
Sourcepub fn read_from_path<P>(path: P) -> Result<Self>
pub fn read_from_path<P>(path: P) -> Result<Self>
Read a file from the specified path.
Sourcepub fn write_to_path<P>(&self, path: P) -> Result<()>
pub fn write_to_path<P>(&self, path: P) -> Result<()>
Write a file to the specified path.
Sourcepub fn inline_all(&mut self, base: &Path) -> Result<()>
pub fn inline_all(&mut self, base: &Path) -> Result<()>
Inline all our external resources, such as env_files, looking up
paths relative to base.
Sourcepub fn make_standalone(&mut self, base: &Path) -> Result<()>
pub fn make_standalone(&mut self, base: &Path) -> Result<()>
Convert this file to a standalone file, with no dependencies on the current environment or any external files. This does not lock down the image versions used in this file.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for File
impl<'de> Deserialize<'de> for File
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
impl Eq for File
Source§impl MergeOverride for File
Recursive merge all fields in the structure.
impl MergeOverride for File
Recursive merge all fields in the structure.
Source§fn merge_override(&self, ovr: &Self) -> Self
fn merge_override(&self, ovr: &Self) -> Self
Given this value and an override value, merge the override value
into this one, producing a new value. Read more
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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