async fn subscribe_actor(
        node: Rc<ThermalLimiter>,
        actor_type: fthermal::ActorType,
        trip_points: Vec<ThermalLoad>,
    ) -> Result<fthermal::ActorRequestStream, fthermal::Error> {
        // Create the proxy objects to be used for subscribing
        let (controller_proxy, controller_stream) =
            fidl::endpoints::create_proxy_and_stream::<fthermal::ControllerMarker>().unwrap();

        // Start the ThermalLimiter Controller server that will handle Subscribe calls from
        // controller_proxy
        node.handle_new_service_connection(controller_stream);

        // Create the proxy objects to be used for SetThermalState callbacks
        let (actor_proxy, actor_stream) =
            fidl::endpoints::create_request_stream::<fthermal::ActorMarker>().unwrap();

        // Subscribe with the ThermalLimiter Controller using the newly created actor proxy object
        // and supplied trip points
        controller_proxy
            .subscribe(actor_proxy, actor_type, &mut trip_points.iter().map(|tp| tp.0 as u32))
            .await
            .unwrap()?;

        // Return the actor stream object to receive state change events later
        Ok(actor_stream)
    }
/// Creates an Actor proxy/stream and subscribes the proxy end to the given ThermalLimiter
/// node. Returns the stream object where thermal state change events (SetThermalState calls)
/// will be delivered.
Creates an Actor proxy/stream and subscribes the proxy end to the given ThermalLimiter
node. Returns the stream object where thermal state change events (SetThermalState calls)
will be delivered.
Creates an Actor proxy / stream and subscribes the proxy end to the given ThermalLimiter node . Returns the stream object where thermal state change events ( SetThermalState calls ) will be delivered .
async fn subscribe_actor(
        node: Rc<ThermalLimiter>,
        actor_type: fthermal::ActorType,
        trip_points: Vec<ThermalLoad>,
    ) -> Result<fthermal::ActorRequestStream, fthermal::Error> {
        // Create the proxy objects to be used for subscribing
        let (controller_proxy, controller_stream) =
            fidl::endpoints::create_proxy_and_stream::<fthermal::ControllerMarker>().unwrap();
        // Start the ThermalLimiter Controller server that will handle Subscribe calls from
        // controller_proxy
        node.handle_new_service_connection(controller_stream);
        // Create the proxy objects to be used for SetThermalState callbacks
        let (actor_proxy, actor_stream) =
            fidl::endpoints::create_request_stream::<fthermal::ActorMarker>().unwrap();
        // Subscribe with the ThermalLimiter Controller using the newly created actor proxy object
        // and supplied trip points
        controller_proxy
            .subscribe(actor_proxy, actor_type, &mut trip_points.iter().map(|tp| tp.0 as u32))
            .await
            .unwrap()?;
        // Return the actor stream object to receive state change events later
        Ok(actor_stream)
    }
async fn subscribe_actor ( node : Rc < ThermalLimiter > , actor_type : fthermal :: ActorType , trip_points : Vec < ThermalLoad > , ) -> Result < fthermal :: ActorRequestStream , fthermal :: Error > { // Create the proxy objects to be used for subscribing let ( controller_proxy , controller_stream ) = fidl :: endpoints :: create_proxy_and_stream :: < fthermal :: ControllerMarker > ( ) . unwrap ( ) ; // Start the ThermalLimiter Controller server that will handle Subscribe calls from // controller_proxy node . handle_new_service_connection ( controller_stream ) ; // Create the proxy objects to be used for SetThermalState callbacks let ( actor_proxy , actor_stream ) = fidl :: endpoints :: create_request_stream :: < fthermal :: ActorMarker > ( ) . unwrap ( ) ; // Subscribe with the ThermalLimiter Controller using the newly created actor proxy object // and supplied trip points controller_proxy . subscribe ( actor_proxy , actor_type , & mut trip_points . iter ( ) . map ( | tp | tp . 0 as u32 ) ) . await . unwrap ( ) ? ; // Return the actor stream object to receive state change events later Ok ( actor_stream ) }
Creates an Actor proxy/stream and subscribes the proxy end to the given ThermalLimiter
node.
Creates an Actor proxy / stream and subscribes the proxy end to the given ThermalLimiter node .
node
Rc<ThermalLimiter>
actor_type
fthermal::ActorType
trip_points
Vec<ThermalLoad>
node
Rc<ThermalLimiter>
actor_type
fthermal::ActorType
trip_points
Vec<ThermalLoad>