1
0
mirror of https://github.com/pcvolkmer/osc-variant.git synced 2025-07-03 01:02:55 +00:00

Show required dependencies not included in OSC file

This commit is contained in:
2023-08-31 16:46:40 +02:00
parent af4ec8898a
commit f507893b4d
4 changed files with 50 additions and 12 deletions

View File

@ -25,10 +25,29 @@
use crate::model::data_catalogue::DataCatalogue;
use crate::model::onkostar_editor::OnkostarEditor;
use crate::model::property_catalogue::PropertyCatalogue;
use crate::model::Listable;
#[allow(clippy::enum_variant_names)]
pub enum Requirement<'a> {
PropertyCatalogue(&'a PropertyCatalogue),
DataCatalogue(&'a DataCatalogue),
ExternalPropertyCatalogue(String),
ExternalDataCatalogue(String),
}
impl ToString for Requirement<'_> {
fn to_string(&self) -> String {
match self {
Requirement::PropertyCatalogue(item) => item.to_listed_string(),
Requirement::DataCatalogue(item) => item.to_listed_string(),
Requirement::ExternalPropertyCatalogue(name) => {
format!("Merkmalskatalog (-) '{}' - hier nicht enthalten", name)
}
Requirement::ExternalDataCatalogue(name) => {
format!("Datenkatalog (-) '{}' - hier nicht enthalten", name)
}
}
}
}
pub trait Requires {