Struct cometd_client::CometdClient
source · pub struct CometdClient<Msg> { /* private fields */ }
Expand description
A cometd Client.
Implementations§
source§impl<Msg> CometdClient<Msg>
impl<Msg> CometdClient<Msg>
sourcepub fn rx(&self) -> CometdEventReceiver<Msg>
pub fn rx(&self) -> CometdEventReceiver<Msg>
Return client event receiver channel.
Example
let mut event_rx = client.rx();
client.subscribe(&["/topic0"]).await;
while let Some(event) = event_rx.recv().await {
println!("Got cometd client event: `{event:?}`.");
}
Trait Implementations§
Auto Trait Implementations§
impl<Msg> !RefUnwindSafe for CometdClient<Msg>
impl<Msg> Send for CometdClient<Msg>where Msg: Send + Sync,
impl<Msg> Sync for CometdClient<Msg>where Msg: Send + Sync,
impl<Msg> Unpin for CometdClient<Msg>
impl<Msg> !UnwindSafe for CometdClient<Msg>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more