/// Connects a `fuchsia.power.clientlevel.Watcher` request stream to a specific client type.
///
/// If successful, the incoming `Watch` requests on the stream will be completed with the power
/// level of the given `client_type` as it changes.
Connects a `fuchsia.power.clientlevel.Watcher` request stream to a specific client type.
If successful, the incoming `Watch` requests on the stream will be completed with the power
level of the given `client_type` as it changes.
Connects a ` fuchsia . power . clientlevel . Watcher ` request stream to a specific client type . If successful the incoming ` Watch ` requests on the stream will be completed with the power level of the given ` client_type ` as it changes .
fn connect_stream_for_client(
        &self,
        client_type: ClientType,
        stream: fpowerclient::WatcherRequestStream,
    ) -> Result<(), Error> {
        fuchsia_trace::duration!(
            "power_manager",
            "SystemPowerModeHandler::connect_stream_for_client"
        );
        match self.states.borrow_mut().get_mut(&client_type) {
            Some(client_state) => {
                client_state.connect_stream(stream);
                Ok(())
            }
            None => Err(format_err!("Unsupported client type: {:?}", client_type)),
        }
    }
fn connect_stream_for_client ( & self , client_type : ClientType , stream : fpowerclient :: WatcherRequestStream , ) -> Result < ( ) , Error > { fuchsia_trace :: duration ! ( " " " " ) ; match self . states . borrow_mut ( ) . get_mut ( & client_type ) { Some ( client_state ) => { client_state . connect_stream ( stream ) ; Ok ( ( ) ) } None => Err ( format_err ! ( " " client_type ) ) , } }
Connects a `fuchsia.power.clientlevel.Watcher` request stream to a specific client type.
Connects a ` fuchsia . power . clientlevel . Watcher ` request stream to a specific client type .
&self
client_type
ClientType
stream
fpowerclient::WatcherRequestStream