pub async fn subscribe<T: AsRef<str>>(
        &self,
        topic: T,
    ) -> Result<(WampId, SubscriptionQueue), WampError> {
        // Send the request
        let (res, result) = oneshot::channel();
        if let Err(e) = self.ctl_channel.send(Request::Subscribe {
            uri: topic.as_ref().to_string(),
            res,
        }) {
            return Err(From::from(format!(
                "Core never received our request : {}",
                e
            )));
        }

        // Wait for the result
        let (sub_id, evt_queue) = match result.await {
            Ok(r) => r?,
            Err(e) => {
                return Err(From::from(format!(
                    "Core never returned a response : {}",
                    e
                )))
            }
        };

        Ok((sub_id, evt_queue))
    }
/// Subscribes to events for the specifiec topic
///
/// This function returns a subscription ID (required to unsubscribe) and
/// the receive end of a channel for events published on the topic.
Subscribes to events for the specifiec topic
This function returns a subscription ID (required to unsubscribe) and
the receive end of a channel for events published on the topic.
Subscribes to events for the specifiec topic This function returns a subscription ID ( required to unsubscribe ) and the receive end of a channel for events published on the topic .
pub async fn subscribe<T: AsRef<str>>(
        &self,
        topic: T,
    ) -> Result<(WampId, SubscriptionQueue), WampError> {
        // Send the request
        let (res, result) = oneshot::channel();
        if let Err(e) = self.ctl_channel.send(Request::Subscribe {
            uri: topic.as_ref().to_string(),
            res,
        }) {
            return Err(From::from(format!(
                "Core never received our request : {}",
                e
            )));
        }
        // Wait for the result
        let (sub_id, evt_queue) = match result.await {
            Ok(r) => r?,
            Err(e) => {
                return Err(From::from(format!(
                    "Core never returned a response : {}",
                    e
                )))
            }
        };
        Ok((sub_id, evt_queue))
    }
pub async fn subscribe < T : AsRef < str > > ( & self , topic : T , ) -> Result < ( WampId , SubscriptionQueue ) , WampError > { // Send the request let ( res , result ) = oneshot :: channel ( ) ; if let Err ( e ) = self . ctl_channel . send ( Request :: Subscribe { uri : topic . as_ref ( ) . to_string ( ) , res , } ) { return Err ( From :: from ( format ! ( " " e ) ) ) ; } // Wait for the result let ( sub_id , evt_queue ) = match result . await { Ok ( r ) => r ? , Err ( e ) => { return Err ( From :: from ( format ! ( " " e ) ) ) } } ; Ok ( ( sub_id , evt_queue ) ) }
Subscribes to events for the specifiec topic
This function returns a subscription ID (required to unsubscribe) and
the receive end of a channel for events published on the topic.
Subscribes to events for the specifiec topic This function returns a subscription ID ( required to unsubscribe ) and the receive end of a channel for events published on the topic .
&self
topic
T