pub async fn run(hd: HostDispatcher, mut stream: ControlRequestStream) -> Result<(), Error> {
    let event_listener = Arc::new(stream.control_handle());
    hd.add_event_listener(Arc::downgrade(&event_listener));
    let mut session = ControlSession::default();

    while let Some(event) = stream.next().await {
        handler(hd.clone(), &mut session, event?).await?;
    }
    // event_listener will now be dropped, closing the listener
    Ok(())
}
/// Build the ControlImpl to interact with fidl messages
/// State is stored in the HostDispatcher object
Build the ControlImpl to interact with fidl messages
State is stored in the HostDispatcher object
Build the ControlImpl to interact with fidl messages State is stored in the HostDispatcher object
pub async fn run(hd: HostDispatcher, mut stream: ControlRequestStream) -> Result<(), Error> {
    let event_listener = Arc::new(stream.control_handle());
    hd.add_event_listener(Arc::downgrade(&event_listener));
    let mut session = ControlSession::default();
    while let Some(event) = stream.next().await {
        handler(hd.clone(), &mut session, event?).await?;
    }
    // event_listener will now be dropped, closing the listener
    Ok(())
}
pub async fn run ( hd : HostDispatcher , mut stream : ControlRequestStream ) -> Result < ( ) , Error > { let event_listener = Arc :: new ( stream . control_handle ( ) ) ; hd . add_event_listener ( Arc :: downgrade ( & event_listener ) ) ; let mut session = ControlSession :: default ( ) ; while let Some ( event ) = stream . next ( ) . await { handler ( hd . clone ( ) , & mut session , event ? ) . await ? ; } // event_listener will now be dropped, closing the listener Ok ( ( ) ) }
Build the ControlImpl to interact with fidl messages
State is stored in the HostDispatcher object
Build the ControlImpl to interact with fidl messages State is stored in the HostDispatcher object
hd
HostDispatcher
stream
ControlRequestStream
hd
HostDispatcher
stream
ControlRequestStream