[][src]Struct watchman_client::Subscription

pub struct Subscription<F> where
    F: DeserializeOwned + Debug + Clone + QueryFieldList, 
{ /* fields omitted */ }

A handle to a subscription initiated via Client::subscribe. Repeatedly call Subscription::next().await to yield the next set of subscription results. Use the cancel method to gracefully halt this subscription if you have a program that creates and destroys subscriptions throughout its lifetime.

Implementations

impl<F> Subscription<F> where
    F: DeserializeOwned + Debug + Clone + QueryFieldList, 
[src]

pub fn name(&self) -> &str[src]

Returns the assigned name for this subscription instance.

pub async fn next(&mut self) -> Result<SubscriptionData<F>, Error>[src]

Yield the next set of subscription data. An error is generated if the subscription is disconnected from the server.

pub async fn cancel(self) -> Result<(), Error>[src]

Gracefully cancel this subscription. If you are imminently about to drop the associated client then you need not call this method. However, if the associated client is going to live much longer than a Subscription that you are about to drop, then it is recommended that you call cancel so that the server will stop delivering data about it.

Auto Trait Implementations

impl<F> !RefUnwindSafe for Subscription<F>[src]

impl<F> Send for Subscription<F> where
    F: Send
[src]

impl<F> Sync for Subscription<F> where
    F: Sync
[src]

impl<F> Unpin for Subscription<F> where
    F: Unpin
[src]

impl<F> !UnwindSafe for Subscription<F>[src]

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.