pub async fn error(
    core: &mut Core<'_>,
    typ: WampInteger,
    request: WampId,
    details: WampDict,
    error: WampUri,
    _arguments: Option<WampArgs>,
    _arguments_kw: Option<WampKwArgs>,
) -> Status {
    let error = WampError::ServerError(error, details);
    match typ {
        SUBSCRIBE_ID => {
            let res = match core.pending_sub.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for subscribe message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        REGISTER_ID => {
            let (_, res) = match core.pending_register.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for RPC register message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        CALL_ID => {
            let res = match core.pending_call.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for CALL message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        PUBLISH_ID | UNSUBSCRIBE_ID | UNREGISTER_ID => {
            let res = match core.pending_transactions.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        _ => {}
    };
    Status::Ok
}
// Handles an error sent by the peer
Handles an error sent by the peer
Handles an error sent by the peer
pub async fn error(
    core: &mut Core<'_>,
    typ: WampInteger,
    request: WampId,
    details: WampDict,
    error: WampUri,
    _arguments: Option<WampArgs>,
    _arguments_kw: Option<WampKwArgs>,
) -> Status {
    let error = WampError::ServerError(error, details);
    match typ {
        SUBSCRIBE_ID => {
            let res = match core.pending_sub.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for subscribe message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        REGISTER_ID => {
            let (_, res) = match core.pending_register.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for RPC register message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        CALL_ID => {
            let res = match core.pending_call.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for CALL message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        PUBLISH_ID | UNSUBSCRIBE_ID | UNREGISTER_ID => {
            let res = match core.pending_transactions.remove(&request) {
                Some(r) => r,
                None => {
                    warn!("Received error for message we never sent");
                    return Status::Ok;
                }
            };
            let _ = res.send(Err(error));
        }
        _ => {}
    };
    Status::Ok
}
pub async fn error ( core : & mut Core < ' _ > , typ : WampInteger , request : WampId , details : WampDict , error : WampUri , _arguments : Option < WampArgs > , _arguments_kw : Option < WampKwArgs > , ) -> Status { let error = WampError :: ServerError ( error , details ) ; match typ { SUBSCRIBE_ID => { let res = match core . pending_sub . remove ( & request ) { Some ( r ) => r , None => { warn ! ( " " ) ; return Status :: Ok ; } } ; let _ = res . send ( Err ( error ) ) ; } REGISTER_ID => { let ( _ , res ) = match core . pending_register . remove ( & request ) { Some ( r ) => r , None => { warn ! ( " " ) ; return Status :: Ok ; } } ; let _ = res . send ( Err ( error ) ) ; } CALL_ID => { let res = match core . pending_call . remove ( & request ) { Some ( r ) => r , None => { warn ! ( " " ) ; return Status :: Ok ; } } ; let _ = res . send ( Err ( error ) ) ; } PUBLISH_ID | UNSUBSCRIBE_ID | UNREGISTER_ID => { let res = match core . pending_transactions . remove ( & request ) { Some ( r ) => r , None => { warn ! ( " " ) ; return Status :: Ok ; } } ; let _ = res . send ( Err ( error ) ) ; } _ => { } } ; Status :: Ok }
Handles an error sent by the peer
Handles an error sent by the peer
core
&mut Core<'_>
typ
WampInteger
request
WampId
details
WampDict
error
WampUri
_arguments
Option<WampArgs>
_arguments_kw
Option<WampKwArgs>