Skip to main content

Watch

Struct Watch 

Source
pub struct Watch { /* private fields */ }
Expand description

An owned subscription.

Dropping it cancels; see the module docs for why that makes #[must_use] load-bearing rather than decorative.

Implementations§

Source§

impl Watch

Source

pub fn id(&self) -> WatchId

The correlation token every notification from this subscription carries.

Copy, so a client can keep it to route or aggregate without holding the subscription’s lifetime (D-5).

Source

pub fn cancel(self)

Stop watching.

The same operation Drop performs, said explicitly. It returns once the cancellation is enqueued, not once it has taken effect, so a notification already in the client’s queue still arrives. The Cancelled completion marks where the watch actually ended (D-30).

Trait Implementations§

Source§

impl Debug for Watch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Watch

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Watch

§

impl !UnwindSafe for Watch

§

impl Forget for Watch

§

impl Freeze for Watch

§

impl Move for Watch

§

impl Send for Watch

§

impl Sync for Watch

§

impl Unpin for Watch

§

impl UnsafeUnpin for Watch

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.