Computes "metadata replica sets" i.e. all metadata dimensions along based on the metadata `schema`. This includes both base and metadata dimensions. Note that the first item in the result will correspond to the base dimensions. This can be used as an assumption. If `fields` is None or an empty map, it will return a vector with a single item i.e. the base dimensions.
(
schema: &MetadataSchema,
fields: Option<&MetadataFields>,
)
| 492 | /// If `fields` is None or an empty map, it will return a vector with |
| 493 | /// a single item i.e. the base dimensions. |
| 494 | fn metadata_replica_set( |
| 495 | schema: &MetadataSchema, |
| 496 | fields: Option<&MetadataFields>, |
| 497 | ) -> Result<Vec<Metadata>, WaCustomError> { |
| 498 | let dims = fields_to_dimensions(schema, fields).map_err(WaCustomError::MetadataError)?; |
| 499 | let replicas = dims.into_iter().map(Metadata::from).collect(); |
| 500 | Ok(replicas) |
| 501 | } |
| 502 | |
| 503 | /// Returns a vector of `NodePropMetadata` instances based on the |
| 504 | /// collection `schema` and `metadata_fields` as per the following |
no test coverage detected