async fn send_message(
        &self,
        node: &Rc<dyn Node>,
        msg: &Message,
    ) -> Result<MessageReturn, PowerManagerError> {
        // TODO(fxbug.dev/44484): Ideally we'd use a duration event here. But due to a limitation in the
        // Rust tracing library, that would require creating any formatted strings (such as the
        // "message" value) unconditionally, even when the tracing category is disabled. To
        // avoid that unnecessary computation, just use an instant event.
        fuchsia_trace::instant!(
            "power_manager:messages",
            "message_start",
            fuchsia_trace::Scope::Thread,
            "message" => format!("{:?}", msg).as_str(),
            "source_node" => self.name().as_str(),
            "dest_node" => node.name().as_str()
        );

        let result = node.handle_message(msg).await;
        fuchsia_trace::instant!(
            "power_manager:messages",
            "message_result",
            fuchsia_trace::Scope::Thread,
            "message" => format!("{:?}", msg).as_str(),
            "source_node" => self.name().as_str(),
            "dest_node" => node.name().as_str(),
            "result" => format!("{:?}", result).as_str()
        );
        result
    }
/// Send a message to another node
///
/// This is implemented as a future to support scenarios where
/// a node wishes to send messages to multiple other nodes.
/// Errors are logged automatically.
Send a message to another node
This is implemented as a future to support scenarios where
a node wishes to send messages to multiple other nodes.
Errors are logged automatically.
Send a message to another node This is implemented as a future to support scenarios where a node wishes to send messages to multiple other nodes . Errors are logged automatically .
async fn send_message(
        &self,
        node: &Rc<dyn Node>,
        msg: &Message,
    ) -> Result<MessageReturn, PowerManagerError> {
        // TODO(fxbug.dev/44484): Ideally we'd use a duration event here. But due to a limitation in the
        // Rust tracing library, that would require creating any formatted strings (such as the
        // "message" value) unconditionally, even when the tracing category is disabled. To
        // avoid that unnecessary computation, just use an instant event.
        fuchsia_trace::instant!(
            "power_manager:messages",
            "message_start",
            fuchsia_trace::Scope::Thread,
            "message" => format!("{:?}", msg).as_str(),
            "source_node" => self.name().as_str(),
            "dest_node" => node.name().as_str()
        );
        let result = node.handle_message(msg).await;
        fuchsia_trace::instant!(
            "power_manager:messages",
            "message_result",
            fuchsia_trace::Scope::Thread,
            "message" => format!("{:?}", msg).as_str(),
            "source_node" => self.name().as_str(),
            "dest_node" => node.name().as_str(),
            "result" => format!("{:?}", result).as_str()
        );
        result
    }
async fn send_message ( & self , node : & Rc < dyn Node > , msg : & Message , ) -> Result < MessageReturn , PowerManagerError > { // TODO(fxbug.dev/44484): Ideally we'd use a duration event here. But due to a limitation in the // Rust tracing library, that would require creating any formatted strings (such as the // "message" value) unconditionally, even when the tracing category is disabled. To // avoid that unnecessary computation, just use an instant event. fuchsia_trace :: instant ! ( " " " " fuchsia_trace Scope Thread " " format ( " " msg ) as_str ( ) " " self name ( ) as_str ( ) " " node name ( ) as_str ( ) ) ; let result = node . handle_message ( msg ) . await ; fuchsia_trace :: instant ! ( " " " " fuchsia_trace Scope Thread " " format ( " " msg ) as_str ( ) " " self name ( ) as_str ( ) " " node name ( ) as_str ( ) " " format ( " " result ) as_str ( ) ) ; result }
Send a message to another node
This is implemented as a future to support scenarios where
a node wishes to send messages to multiple other nodes.
Send a message to another node This is implemented as a future to support scenarios where a node wishes to send messages to multiple other nodes .
&self
node
&Rc<dyn Node>
msg
&Message
&self
node
&Rc<dyn Node>
msg
&Message