[−][src]Struct watchman_client::Subscription
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]
F: DeserializeOwned + Debug + Clone + QueryFieldList,
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]
F: Send,
impl<F> Sync for Subscription<F> where
F: Sync,
[src]
F: Sync,
impl<F> Unpin for Subscription<F> where
F: Unpin,
[src]
F: Unpin,
impl<F> !UnwindSafe for Subscription<F>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,