pub struct ComposeYaml { /* private fields */ }Implementations§
Source§impl ComposeYaml
impl ComposeYaml
pub fn new(yaml: &str) -> Result<ComposeYaml, Error>
pub fn to_string(&self) -> Result<String, Error>
pub fn get_root_element(&self, element_name: &str) -> Option<&Mapping>
pub fn get_root_element_names(&self, element_name: &str) -> Vec<&str>
pub fn get_services(&self) -> Option<&Mapping>
pub fn get_profiles_names(&self) -> Option<Vec<&str>>
pub fn get_images( &self, filter_by_tag: Option<&str>, tag: Option<&ReplaceTag>, ) -> Option<Vec<String>>
Sourcepub fn update_images_tag(&mut self, replace_tag: &ReplaceTag)
pub fn update_images_tag(&mut self, replace_tag: &ReplaceTag)
Update all services’ image attributes with the tag passed if the tag exists locally or in the remote registry, otherwise the image value is untouched.
pub fn get_service(&self, service_name: &str) -> Option<&Mapping>
Sourcepub fn filter_services_by_names(
&self,
service_names: &[String],
) -> Vec<(String, &Mapping)>
pub fn filter_services_by_names( &self, service_names: &[String], ) -> Vec<(String, &Mapping)>
Return the list of services found in a vector of tuples (name, service).
If the list is smaller than service_names.len(), means one or more
services don’t exist
Sourcepub fn filter_services_by_image_tag(
&self,
filter_by_tag: &str,
) -> Vec<(String, &Mapping)>
pub fn filter_services_by_image_tag( &self, filter_by_tag: &str, ) -> Vec<(String, &Mapping)>
Return the list of services found in a vector of tuples (name, service), filtering by image tag name.
Sourcepub fn get_services_by_names(
&self,
service_names: &[String],
) -> Result<Vec<(String, &Mapping)>, Vec<String>>
pub fn get_services_by_names( &self, service_names: &[String], ) -> Result<Vec<(String, &Mapping)>, Vec<String>>
Like filter_services_by_names, but return the list of services if all
elements exist, otherwise it fails with a list of services not found.
Sourcepub fn get_services_depends_on(
&self,
service_names: &[String],
) -> Result<Vec<String>, Vec<String>>
pub fn get_services_depends_on( &self, service_names: &[String], ) -> Result<Vec<String>, Vec<String>>
List of services that are dependencies of the list of services passed. If some of the service names passed don’t exist, return a list of services not found as an error.
Sourcepub fn get_services_dependants(
&self,
service_names: &[String],
) -> Option<Vec<String>>
pub fn get_services_dependants( &self, service_names: &[String], ) -> Option<Vec<String>>
Return the list of services that are dependents of the list of services passed.