pub(crate) fn subscribe(
        self,
        tp: &Transport,
        subject: &str,
    ) -> Result<Subscription, TibrvError> {
        let (send, recv) = mpsc::channel();
        let subject_c = CString::new(subject).context(ErrorKind::StrContentError)?;

        let mut ptr: tibrvEvent = unsafe { mem::zeroed() };
        let send_ptr = Box::into_raw(Box::new(send.clone()));
        unsafe {
            tibrvEvent_CreateListener(
                &mut ptr,
                self.inner,
                Some(sync_callback),
                tp.inner,
                subject_c.as_ptr(),
                send_ptr as *const ::std::os::raw::c_void,
            )
        }.map(|_| Subscription {
            event: ptr,
            queue: self,
            channel: recv,
        })
    }
/// Subscribe to a message subject.
///
/// Sets up the callback to copy messages from the event
/// queue into a `mpsc::channel` for consumption from Rust.
///
/// Requires a reference to a valid `Transport` on which to listen.
///
/// Subject must be valid ASCII, wildcards are accepted, although
/// a wildcard-only subject is not.
Subscribe to a message subject.
Sets up the callback to copy messages from the event
queue into a `mpsc::channel` for consumption from Rust.

Requires a reference to a valid `Transport` on which to listen.

Subject must be valid ASCII, wildcards are accepted, although
a wildcard-only subject is not.
Subscribe to a message subject . Sets up the callback to copy messages from the event queue into a ` mpsc :: channel ` for consumption from Rust . Requires a reference to a valid ` Transport ` on which to listen . Subject must be valid ASCII wildcards are accepted although a wildcard - only subject is not .
pub(crate) fn subscribe(
        self,
        tp: &Transport,
        subject: &str,
    ) -> Result<Subscription, TibrvError> {
        let (send, recv) = mpsc::channel();
        let subject_c = CString::new(subject).context(ErrorKind::StrContentError)?;
        let mut ptr: tibrvEvent = unsafe { mem::zeroed() };
        let send_ptr = Box::into_raw(Box::new(send.clone()));
        unsafe {
            tibrvEvent_CreateListener(
                &mut ptr,
                self.inner,
                Some(sync_callback),
                tp.inner,
                subject_c.as_ptr(),
                send_ptr as *const ::std::os::raw::c_void,
            )
        }.map(|_| Subscription {
            event: ptr,
            queue: self,
            channel: recv,
        })
    }
pub ( crate ) fn subscribe ( self , tp : & Transport , subject : & str , ) -> Result < Subscription , TibrvError > { let ( send , recv ) = mpsc :: channel ( ) ; let subject_c = CString :: new ( subject ) . context ( ErrorKind :: StrContentError ) ? ; let mut ptr : tibrvEvent = unsafe { mem :: zeroed ( ) } ; let send_ptr = Box :: into_raw ( Box :: new ( send . clone ( ) ) ) ; unsafe { tibrvEvent_CreateListener ( & mut ptr , self . inner , Some ( sync_callback ) , tp . inner , subject_c . as_ptr ( ) , send_ptr as * const :: std :: os :: raw :: c_void , ) } . map ( | _ | Subscription { event : ptr , queue : self , channel : recv , } ) }
Subscribe to a message subject.
Subscribe to a message subject .
self
tp
&Transport
subject
&str
self
tp
&Transport
subject
&str