async fn create_node<'a, 'b>(
        &mut self,
        json_data: json::Value,
        service_fs: &'a mut ServiceFs<ServiceObjLocal<'b, ()>>,
    ) -> Result<Rc<dyn Node>, Error> {
        Ok(match json_data["type"].as_str().unwrap() {
            "CpuControlHandler" => {
                cpu_control_handler::CpuControlHandlerBuilder::new_from_json(json_data, &self.nodes)
                    .build()
                    .await?
            }
            "CpuStatsHandler" => {
                cpu_stats_handler::CpuStatsHandlerBuilder::new_from_json(json_data, &self.nodes)
                    .build()
                    .await?
            }
            "DeviceControlHandler" => {
                dev_control_handler::DeviceControlHandlerBuilder::new_from_json(
                    json_data,
                    &self.nodes,
                )
                .build()?
            }
            "SystemPowerHandler" => {
                system_power_handler::SystemPowerStateHandlerBuilder::new_from_json(
                    json_data,
                    &self.nodes,
                )
                .build()?
            }
            "TemperatureHandler" => temperature_handler::TemperatureHandlerBuilder::new_from_json(
                json_data,
                &self.nodes,
            )
            .build()?,
            "ThermalLimiter" => thermal_limiter::ThermalLimiterBuilder::new_from_json(
                json_data,
                &self.nodes,
                service_fs,
            )
            .build()?,
            "ThermalPolicy" => {
                thermal_policy::ThermalPolicyBuilder::new_from_json(json_data, &self.nodes)
                    .build()?
            }
            unknown => panic!("Unknown node type: {}", unknown),
        })
    }
/// Uses the supplied `json_data` to construct a single node, where `json_data` is the JSON
/// object corresponding to a single node configuration.
Uses the supplied `json_data` to construct a single node, where `json_data` is the JSON
object corresponding to a single node configuration.
Uses the supplied ` json_data ` to construct a single node where ` json_data ` is the JSON object corresponding to a single node configuration .
async fn create_node<'a, 'b>(
        &mut self,
        json_data: json::Value,
        service_fs: &'a mut ServiceFs<ServiceObjLocal<'b, ()>>,
    ) -> Result<Rc<dyn Node>, Error> {
        Ok(match json_data["type"].as_str().unwrap() {
            "CpuControlHandler" => {
                cpu_control_handler::CpuControlHandlerBuilder::new_from_json(json_data, &self.nodes)
                    .build()
                    .await?
            }
            "CpuStatsHandler" => {
                cpu_stats_handler::CpuStatsHandlerBuilder::new_from_json(json_data, &self.nodes)
                    .build()
                    .await?
            }
            "DeviceControlHandler" => {
                dev_control_handler::DeviceControlHandlerBuilder::new_from_json(
                    json_data,
                    &self.nodes,
                )
                .build()?
            }
            "SystemPowerHandler" => {
                system_power_handler::SystemPowerStateHandlerBuilder::new_from_json(
                    json_data,
                    &self.nodes,
                )
                .build()?
            }
            "TemperatureHandler" => temperature_handler::TemperatureHandlerBuilder::new_from_json(
                json_data,
                &self.nodes,
            )
            .build()?,
            "ThermalLimiter" => thermal_limiter::ThermalLimiterBuilder::new_from_json(
                json_data,
                &self.nodes,
                service_fs,
            )
            .build()?,
            "ThermalPolicy" => {
                thermal_policy::ThermalPolicyBuilder::new_from_json(json_data, &self.nodes)
                    .build()?
            }
            unknown => panic!("Unknown node type: {}", unknown),
        })
    }
async fn create_node < ' a , ' b > ( & mut self , json_data : json :: Value , service_fs : & ' a mut ServiceFs < ServiceObjLocal < ' b , ( ) > > , ) -> Result < Rc < dyn Node > , Error > { Ok ( match json_data [ " " ] . as_str ( ) . unwrap ( ) { " " => { cpu_control_handler :: CpuControlHandlerBuilder :: new_from_json ( json_data , & self . nodes ) . build ( ) . await ? } " " => { cpu_stats_handler :: CpuStatsHandlerBuilder :: new_from_json ( json_data , & self . nodes ) . build ( ) . await ? } " " => { dev_control_handler :: DeviceControlHandlerBuilder :: new_from_json ( json_data , & self . nodes , ) . build ( ) ? } " " => { system_power_handler :: SystemPowerStateHandlerBuilder :: new_from_json ( json_data , & self . nodes , ) . build ( ) ? } " " => temperature_handler :: TemperatureHandlerBuilder :: new_from_json ( json_data , & self . nodes , ) . build ( ) ? , " " => thermal_limiter :: ThermalLimiterBuilder :: new_from_json ( json_data , & self . nodes , service_fs , ) . build ( ) ? , " " => { thermal_policy :: ThermalPolicyBuilder :: new_from_json ( json_data , & self . nodes ) . build ( ) ? } unknown => panic ! ( " " unknown ) , } ) }
Uses the supplied `json_data` to construct a single node, where `json_data` is the JSON
object corresponding to a single node configuration.
Uses the supplied ` json_data ` to construct a single node where ` json_data ` is the JSON object corresponding to a single node configuration .
&mut self
json_data
json::Value
service_fs
&'a mut ServiceFs<ServiceObjLocal<'b, ()>>
&mut self
json_data
json::Value
service_fs
&'a mut ServiceFs<ServiceObjLocal<'b, ()>>