sl4f_lib/location/
regulatory_region_facade.rsuse anyhow::Error;
use fidl_fuchsia_location_namedplace::{
RegulatoryRegionConfiguratorMarker, RegulatoryRegionConfiguratorProxy,
};
use fuchsia_component::client::connect_to_protocol;
#[derive(Debug)]
pub struct RegulatoryRegionFacade {
configurator: RegulatoryRegionConfiguratorProxy,
}
impl RegulatoryRegionFacade {
pub fn new() -> Result<RegulatoryRegionFacade, Error> {
Ok(RegulatoryRegionFacade {
configurator: connect_to_protocol::<RegulatoryRegionConfiguratorMarker>()?,
})
}
pub fn set_region(&self, region_code: &str) -> Result<(), Error> {
self.configurator.set_region(region_code)?;
Ok(())
}
}