fn select_literal(
    &self,
    context: &Context,
    candidate: Value,
    variant_value: &Option<String>,
  ) -> Option<Value> {
    // Check whether the subject is-a instance of the product.
    if self.select_literal_single(&candidate, variant_value) {
      return Some(candidate);
    }

    // Else, check whether it has-a instance of the product.
    // TODO: returning only the first literal configuration of a given type/variant. Need to
    // define mergeability for products.
    if externs::satisfied_by(&context.core.types.has_products, &candidate) {
      for child in externs::project_multi(&candidate, "products") {
        if self.select_literal_single(&child, variant_value) {
          return Some(child);
        }
      }
    }
    None
  }
///
/// Looks for has-a or is-a relationships between the given value and the requested product.
///
/// Returns the resulting product value, or None if no match was made.
///
Looks for has-a or is-a relationships between the given value and the requested product.
Returns the resulting product value, or None if no match was made.
Looks for has - a or is - a relationships between the given value and the requested product . Returns the resulting product value or None if no match was made .
fn select_literal(
    &self,
    context: &Context,
    candidate: Value,
    variant_value: &Option<String>,
  ) -> Option<Value> {
    // Check whether the subject is-a instance of the product.
    if self.select_literal_single(&candidate, variant_value) {
      return Some(candidate);
    }
    // Else, check whether it has-a instance of the product.
    // TODO: returning only the first literal configuration of a given type/variant. Need to
    // define mergeability for products.
    if externs::satisfied_by(&context.core.types.has_products, &candidate) {
      for child in externs::project_multi(&candidate, "products") {
        if self.select_literal_single(&child, variant_value) {
          return Some(child);
        }
      }
    }
    None
  }
fn select_literal ( & self , context : & Context , candidate : Value , variant_value : & Option < String > , ) -> Option < Value > { // Check whether the subject is-a instance of the product. if self . select_literal_single ( & candidate , variant_value ) { return Some ( candidate ) ; } // Else, check whether it has-a instance of the product. // TODO: returning only the first literal configuration of a given type/variant. Need to // define mergeability for products. if externs :: satisfied_by ( & context . core . types . has_products , & candidate ) { for child in externs :: project_multi ( & candidate , " " ) { if self . select_literal_single ( & child , variant_value ) { return Some ( child ) ; } } } None }
Looks for has-a or is-a relationships between the given value and the requested product.
Looks for has - a or is - a relationships between the given value and the requested product .
&self
context
&Context
candidate
Value
variant_value
&Option<String>
&self
context
&Context
candidate
Value
variant_value
&Option<String>