(region_config_id: &str)
| 73 | } |
| 74 | |
| 75 | pub fn get(region_config_id: &str) -> Result<Arc<Box<dyn region::Region + Sync + Send>>> { |
| 76 | let regions_r = REGIONS.read().unwrap(); |
| 77 | Ok(regions_r |
| 78 | .get(region_config_id) |
| 79 | .ok_or_else(|| { |
| 80 | anyhow!( |
| 81 | "region_config_id '{}' does not exist in REGIONS", |
| 82 | region_config_id |
| 83 | ) |
| 84 | })? |
| 85 | .clone()) |
| 86 | } |
| 87 | |
| 88 | /// This returns the (first) region-name, based on the given common-name. |
| 89 | /// This function is used for roaming, as within the context of roaming, only |