Struct cage::Pod
[−]
[src]
pub struct Pod { /* fields omitted */ }
A pod, specified by pods/$NAME.yml
and zero or more
pods/targets/*/*.yml
targets that we can apply to it.
Methods
impl Pod
[src]
fn name(&self) -> &str
Get the name of this pod.
fn pod_type(&self) -> PodType
Get the type of this pod.
fn service_names(&self) -> &BTreeSet<String>
Get the names of the services declared in this pod.
fn enabled_in(&self, target: &Target) -> bool
Is this pod enabled in the specified target?
fn base_dir(&self) -> &Path
The base directory for our relative paths.
fn rel_path(&self) -> &Path
The path to the top-level file defining this pod, relative to the
base_dir
specified at creation time.
fn file(&self) -> &File
The top-level file defining this pod. This is normalized to
include the appropriate env_file
entries, but if you want to do
more complicated transformations, you'll need to clone it with
to_owned()
first.
fn target_rel_path(&self, target: &Target) -> Result<&Path>
The path to the specificied target file for this pod.
fn target_file(&self, target: &Target) -> Result<&File>
The dc::File
for this target.
fn merged_file(&self, target: &Target) -> Result<File>
Return the base file and the target file merged into a single
docker-compose.yml
file.
fn target_files(&self) -> TargetFiles
All the targets associated with this pod.
fn all_files(&self) -> AllFiles
Iterate over all dc::File
objects associated with this pod, including
both the main file()
and all the files in target_files()
.
fn service(&self, target: &Target, name: &str) -> Result<Option<Service>>
Look up a service by name.
fn service_or_err(&self, target: &Target, name: &str) -> Result<Service>
Like service
, but returns an error if the service can't be found.
fn compose_args(&self, proj: &Project, target: &Target) -> Result<Vec<OsString>>
Command-line -p
and -f
arguments that we'll pass to
docker-compose
to describe this file.