/// Connects to the Cobalt FIDL service. And returns a tuple of type `(CobaltSender, impl
/// Future<Output = ()>)`. The `CobaltSender` is used for sending cobalt events to the FIDL
/// service, and the `impl Future<Output = ()>` represents the sending thread and can be joined
/// against.
///
/// # Arguments
///
/// * `connection_type` - The `ConnectionType` desired.
Connects to the Cobalt FIDL service. And returns a tuple of type `(CobaltSender, impl
Future)`. The `CobaltSender` is used for sending cobalt events to the FIDL
service, and the `impl Future` represents the sending thread and can be joined
against.
Connects to the Cobalt FIDL service . And returns a tuple of type ` ( CobaltSender impl Future ) ` . The ` CobaltSender ` is used for sending cobalt events to the FIDL service and the ` impl Future ` represents the sending thread and can be joined against .
pub fn serve(
        self,
        connection_type: ConnectionType,
    ) -> (CobaltSender, impl Future<Output = ()>) {
        let (sender, receiver) = mpsc::channel(self.buffer_size);
        let sender = CobaltSender::new(sender);
        let fut = async move {
            let logger = match await!(self.get_cobalt_logger(connection_type)) {
                Ok(logger) => logger,
                Err(e) => {
                    error!("Error obtaining a Cobalt Logger: {}", e);
                    return;
                }
            };
            await!(Self::send_cobalt_events(logger, receiver))
        };
        (sender, fut)
    }
pub fn serve ( self , connection_type : ConnectionType , ) -> ( CobaltSender , impl Future < Output = ( ) > ) { let ( sender , receiver ) = mpsc :: channel ( self . buffer_size ) ; let sender = CobaltSender :: new ( sender ) ; let fut = async move { let logger = match await ! ( self get_cobalt_logger ( connection_type ) ) { Ok ( logger ) => logger , Err ( e ) => { error ! ( " " e ) ; return ; } } ; await ! ( Self send_cobalt_events ( logger receiver ) ) } ; ( sender , fut ) }
Connects to the Cobalt FIDL service.
Connects to the Cobalt FIDL service .
self
connection_type
ConnectionType