fn result_from_sme_raw_status(
    raw_status: zx::zx_status_t,
    station_mode: StationMode,
    iface_id: u16,
) -> Result<(), Error> {
    match zx::Status::from_raw(raw_status) {
        zx::Status::OK => Ok(()),
        zx::Status::NOT_FOUND => Err(Error::msg("invalid interface id")),
        zx::Status::NOT_SUPPORTED => Err(Error::msg("operation not supported on SME interface")),
        zx::Status::INTERNAL => {
            Err(Error::msg("internal server error sending endpoint to the SME server future"))
        }
        _ => Err(Error::msg("unrecognized error associated with SME interface")),
    }
    .context(format!(
        "Failed to access {} for interface id {}. \
                      Please ensure the selected iface supports {} mode.",
        station_mode, iface_id, station_mode,
    ))
}
/// Constructs a `Result<(), Error>` from a `zx::zx_status_t` returned
/// from one of the `get_client_sme`, `get_ap_sme`, or `get_mesh_sme`
/// functions. In particular, when `zx::Status::from_raw(raw_status)` does
/// not match `zx::Status::OK`, this function will attach the appropriate
/// error message to the returned `Result`. When `zx::Status::from_raw(raw_status)`
/// does match `zx::Status::OK`, this function returns `Ok()`.
///
/// If this function returns an `Err`, it includes both a cause and a context.
/// The cause is a readable conversion of `raw_status` based on `station_mode`
/// and `iface_id`. The context notes the failed operation and suggests the
/// interface be checked for support of the given `station_mode`.


If this function returns an `Err`, it includes both a cause and a context.
If this function returns an ` Err ` it includes both a cause and a context .
fn result_from_sme_raw_status(
    raw_status: zx::zx_status_t,
    station_mode: StationMode,
    iface_id: u16,
) -> Result<(), Error> {
    match zx::Status::from_raw(raw_status) {
        zx::Status::OK => Ok(()),
        zx::Status::NOT_FOUND => Err(Error::msg("invalid interface id")),
        zx::Status::NOT_SUPPORTED => Err(Error::msg("operation not supported on SME interface")),
        zx::Status::INTERNAL => {
            Err(Error::msg("internal server error sending endpoint to the SME server future"))
        }
        _ => Err(Error::msg("unrecognized error associated with SME interface")),
    }
    .context(format!(
        "Failed to access {} for interface id {}. \
                      Please ensure the selected iface supports {} mode.",
        station_mode, iface_id, station_mode,
    ))
}
fn result_from_sme_raw_status ( raw_status : zx :: zx_status_t , station_mode : StationMode , iface_id : u16 , ) -> Result < ( ) , Error > { match zx :: Status :: from_raw ( raw_status ) { zx :: Status :: OK => Ok ( ( ) ) , zx :: Status :: NOT_FOUND => Err ( Error :: msg ( " " ) ) , zx :: Status :: NOT_SUPPORTED => Err ( Error :: msg ( " " ) ) , zx :: Status :: INTERNAL => { Err ( Error :: msg ( " " ) ) } _ => Err ( Error :: msg ( " " ) ) , } . context ( format ! ( " \
 " station_mode iface_id station_mode ) ) }
Constructs a `Result<(), Error>` from a `zx::zx_status_t` returned
from one of the `get_client_sme`, `get_ap_sme`, or `get_mesh_sme`
functions.
Constructs a ` Result< () Error > ` from a ` zx :: zx_status_t ` returned from one of the ` get_client_sme ` ` get_ap_sme ` or ` get_mesh_sme ` functions .
raw_status
zx::zx_status_t
station_mode
StationMode
iface_id
u16
raw_status
zx::zx_status_t
station_mode
StationMode
iface_id
u16