[][src]Struct cord_client::Subscriber

pub struct Subscriber { /* fields omitted */ }

A Subscriber encapsulates a stream of events for a subscribed namespace. It is created by Client::subscribe().


let mut conn = Client::connect("".parse().unwrap()).await?;
    .and_then(|sub| async {
        sub.for_each(|(namespace, data)| {
            // Handle the message...
            dbg!("Received the namespace '{}' with data: {}", namespace, data);

Trait Implementations

impl Stream for Subscriber[src]

type Item = (Pattern, String)

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<St> StreamExt for St where
    St: Stream + ?Sized

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.