async fn create_event_fidl_object(
    event: Event,
) -> Result<(Option<BoxFuture<'static, ()>>, fsys::Event), fidl::Error> {
    let moniker_string = match (&event.event.target_moniker, &event.scope_moniker) {
        (moniker @ ExtendedMoniker::ComponentManager, _) => moniker.to_string(),
        (ExtendedMoniker::ComponentInstance(target), ExtendedMoniker::ComponentManager) => {
            RelativeMoniker::from_absolute(&AbsoluteMoniker::root(), &target).to_string()
        }
        (ExtendedMoniker::ComponentInstance(target), ExtendedMoniker::ComponentInstance(scope)) => {
            RelativeMoniker::from_absolute(&scope, &target).to_string()
        }
    };
    let header = Some(fsys::EventHeader {
        event_type: Some(event.event.event_type().into()),
        moniker: Some(moniker_string),
        component_url: Some(event.event.component_url.clone()),
        timestamp: Some(event.event.timestamp.into_nanos()),
        ..fsys::EventHeader::EMPTY
    });
    let event_result = maybe_create_event_result(&event.scope_moniker, &event.event.result).await?;
    let (opt_fut, handler) = maybe_serve_handler_async(event);
    Ok((opt_fut, fsys::Event { header, handler, event_result, ..fsys::Event::EMPTY }))
}
/// Creates the basic FIDL Event object containing the event type, target_moniker
/// and basic handler for resumption. It returns a tuple of the future to run the
/// handler, and the FIDL event.
Creates the basic FIDL Event object containing the event type, target_moniker
and basic handler for resumption. It returns a tuple of the future to run the
handler, and the FIDL event.
Creates the basic FIDL Event object containing the event type target_moniker and basic handler for resumption . It returns a tuple of the future to run the handler and the FIDL event .
async fn create_event_fidl_object(
    event: Event,
) -> Result<(Option<BoxFuture<'static, ()>>, fsys::Event), fidl::Error> {
    let moniker_string = match (&event.event.target_moniker, &event.scope_moniker) {
        (moniker @ ExtendedMoniker::ComponentManager, _) => moniker.to_string(),
        (ExtendedMoniker::ComponentInstance(target), ExtendedMoniker::ComponentManager) => {
            RelativeMoniker::from_absolute(&AbsoluteMoniker::root(), &target).to_string()
        }
        (ExtendedMoniker::ComponentInstance(target), ExtendedMoniker::ComponentInstance(scope)) => {
            RelativeMoniker::from_absolute(&scope, &target).to_string()
        }
    };
    let header = Some(fsys::EventHeader {
        event_type: Some(event.event.event_type().into()),
        moniker: Some(moniker_string),
        component_url: Some(event.event.component_url.clone()),
        timestamp: Some(event.event.timestamp.into_nanos()),
        ..fsys::EventHeader::EMPTY
    });
    let event_result = maybe_create_event_result(&event.scope_moniker, &event.event.result).await?;
    let (opt_fut, handler) = maybe_serve_handler_async(event);
    Ok((opt_fut, fsys::Event { header, handler, event_result, ..fsys::Event::EMPTY }))
}
async fn create_event_fidl_object ( event : Event , ) -> Result < ( Option < BoxFuture < ' static , ( ) > > , fsys :: Event ) , fidl :: Error > { let moniker_string = match ( & event . event . target_moniker , & event . scope_moniker ) { ( moniker @ ExtendedMoniker :: ComponentManager , _ ) => moniker . to_string ( ) , ( ExtendedMoniker :: ComponentInstance ( target ) , ExtendedMoniker :: ComponentManager ) => { RelativeMoniker :: from_absolute ( & AbsoluteMoniker :: root ( ) , & target ) . to_string ( ) } ( ExtendedMoniker :: ComponentInstance ( target ) , ExtendedMoniker :: ComponentInstance ( scope ) ) => { RelativeMoniker :: from_absolute ( & scope , & target ) . to_string ( ) } } ; let header = Some ( fsys :: EventHeader { event_type : Some ( event . event . event_type ( ) . into ( ) ) , moniker : Some ( moniker_string ) , component_url : Some ( event . event . component_url . clone ( ) ) , timestamp : Some ( event . event . timestamp . into_nanos ( ) ) , .. fsys :: EventHeader :: EMPTY } ) ; let event_result = maybe_create_event_result ( & event . scope_moniker , & event . event . result ) . await ? ; let ( opt_fut , handler ) = maybe_serve_handler_async ( event ) ; Ok ( ( opt_fut , fsys :: Event { header , handler , event_result , .. fsys :: Event :: EMPTY } ) ) }
Creates the basic FIDL Event object containing the event type, target_moniker
and basic handler for resumption.
Creates the basic FIDL Event object containing the event type target_moniker and basic handler for resumption .
event
Event
event
Event