async fn stopping_state(
    responder: oneshot::Sender<()>,
    proxy: fidl_sme::ApSmeProxy,
    next_req: NextReqFut,
    sender: ApListenerMessageSender,
) -> Result<State, ExitReason> {
    let result = match proxy.stop().await {
        Ok(fidl_sme::StopApResultCode::Success) => Ok(()),
        Ok(code) => Err(format_err!("Unexpected StopApResultCode: {:?}", code)),
        Err(e) => Err(format_err!("Failed to send a stop command to wlanstack: {}", e)),
    };

    // If the stop command fails, the SME is probably unusable.  If the state is not updated before
    // evaluating the stop result code, the AP state updates may end up with a lingering reference
    // to a started or starting AP.
    send_ap_stopped_update(&sender).map_err(|e| ExitReason(Err(anyhow::Error::from(e))))?;
    result.map_err(|e| ExitReason(Err(e)))?;

    // Ack the request to stop the AP.
    responder.send(()).unwrap_or_else(|_| ());

    Ok(stopped_state(proxy, next_req, sender).into_state())
}
/// In the stopping state, an ApSmeProxy::Stop is requested.  Once the stop request has been
/// processed by the ApSmeProxy, all requests to stop the AP are acknowledged.  The state machine
/// then transitions into the stopped state.
///
/// The stopping state can be entered in the following ways.
/// 1. When a manual stop request is made when the state machine is in the started state.
///
/// The stopping state can be exited in the following ways.
/// 1. When the request to stop the SME completes, the state machine will transition to the stopped
///    state.
/// 2. If an SME interaction fails, exits the state machine with an error.
In the stopping state, an ApSmeProxy::Stop is requested.  Once the stop request has been
processed by the ApSmeProxy, all requests to stop the AP are acknowledged.  The state machine
then transitions into the stopped state.

The stopping state can be entered in the following ways.
1. When a manual stop request is made when the state machine is in the started state.

The stopping state can be exited in the following ways.
1. When the request to stop the SME completes, the state machine will transition to the stopped
state.
2. If an SME interaction fails, exits the state machine with an error.
In the stopping state an ApSmeProxy :: Stop is requested . Once the stop request has been processed by the ApSmeProxy all requests to stop the AP are acknowledged . The state machine then transitions into the stopped state . The stopping state can be entered in the following ways . 1 . When a manual stop request is made when the state machine is in the started state . The stopping state can be exited in the following ways . 1 . When the request to stop the SME completes the state machine will transition to the stopped state . 2 . If an SME interaction fails exits the state machine with an error .
async fn stopping_state(
    responder: oneshot::Sender<()>,
    proxy: fidl_sme::ApSmeProxy,
    next_req: NextReqFut,
    sender: ApListenerMessageSender,
) -> Result<State, ExitReason> {
    let result = match proxy.stop().await {
        Ok(fidl_sme::StopApResultCode::Success) => Ok(()),
        Ok(code) => Err(format_err!("Unexpected StopApResultCode: {:?}", code)),
        Err(e) => Err(format_err!("Failed to send a stop command to wlanstack: {}", e)),
    };
    // If the stop command fails, the SME is probably unusable.  If the state is not updated before
    // evaluating the stop result code, the AP state updates may end up with a lingering reference
    // to a started or starting AP.
    send_ap_stopped_update(&sender).map_err(|e| ExitReason(Err(anyhow::Error::from(e))))?;
    result.map_err(|e| ExitReason(Err(e)))?;
    // Ack the request to stop the AP.
    responder.send(()).unwrap_or_else(|_| ());
    Ok(stopped_state(proxy, next_req, sender).into_state())
}
async fn stopping_state ( responder : oneshot :: Sender < ( ) > , proxy : fidl_sme :: ApSmeProxy , next_req : NextReqFut , sender : ApListenerMessageSender , ) -> Result < State , ExitReason > { let result = match proxy . stop ( ) . await { Ok ( fidl_sme :: StopApResultCode :: Success ) => Ok ( ( ) ) , Ok ( code ) => Err ( format_err ! ( " " code ) ) , Err ( e ) => Err ( format_err ! ( " " e ) ) , } ; // If the stop command fails, the SME is probably unusable.  If the state is not updated before // evaluating the stop result code, the AP state updates may end up with a lingering reference // to a started or starting AP. send_ap_stopped_update ( & sender ) . map_err ( | e | ExitReason ( Err ( anyhow :: Error :: from ( e ) ) ) ) ? ; result . map_err ( | e | ExitReason ( Err ( e ) ) ) ? ; // Ack the request to stop the AP. responder . send ( ( ) ) . unwrap_or_else ( | _ | ( ) ) ; Ok ( stopped_state ( proxy , next_req , sender ) . into_state ( ) ) }
In the stopping state, an ApSmeProxy::Stop is requested.
In the stopping state an ApSmeProxy :: Stop is requested .
responder
oneshot::Sender<()>
proxy
fidl_sme::ApSmeProxy
next_req
NextReqFut
sender
ApListenerMessageSender
responder
oneshot::Sender<()>
proxy
fidl_sme::ApSmeProxy
next_req
NextReqFut
sender
ApListenerMessageSender