[][src]Struct netidx::subscriber::Val

pub struct Val(_);

A non durable subscription to a value. If all user held references to Val are dropped then it will be unsubscribed.

Implementations

impl Val[src]

pub fn downgrade(&self) -> ValWeak[src]

pub async fn last<'_>(&'_ self) -> Option<Value>[src]

Get the last published value, or None if the subscription is dead. Will only return None if the subscription is dead, otherwise there WILL be a value.

pub fn updates(&self, begin_with_last: bool, tx: Sender<Batch>)[src]

Register tx to receive updates to this Val. If begin_with_last is true, then an immediate update will be sent consisting of the last value received from the publisher.

You may register multiple different channels to receive updates from a Val, and you may register one channel to receive updates from multiple Vals.

pub fn write(&self, v: Value)[src]

Write a value back to the publisher. This will start going out as soon as this method returns, and you can call flush on the subscriber to get pushback in case of a slow publisher.

The publisher will receive multiple writes in the order you call write.

pub fn id(&self) -> SubId[src]

Get the unique id of this subscription.

Trait Implementations

impl Clone for Val[src]

impl Debug for Val[src]

Auto Trait Implementations

impl !RefUnwindSafe for Val

impl Send for Val

impl Sync for Val

impl Unpin for Val

impl !UnwindSafe for Val

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,