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

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 fn last(&self) -> Event[src]

Get the last event value.

pub fn updates(
    &self,
    flags: UpdatesFlags,
    tx: Sender<Pooled<Vec<(SubId, Event)>>>
)
[src]

Register tx to receive updates to this Val.

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

If you register multiple channels pointing to the same receiver you will not get duplicate updates. However, if you register a duplicate channel and begin_with_last is true you will get an update with the current state, even though the channel registration will be ignored.

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.

The publisher will not reply to your write, except that it may update values you are subscribed to, or trigger some other observable action.

pub fn write_with_recipt(&self, v: Value) -> Receiver<Value>[src]

This does the same thing as write except that it requires the publisher send a reply indicating the outcome of the request. The reply can be read from the returned oneshot channel.

Note that compared to write this function has higher overhead, avoid it in situations where high message volumes are required.

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> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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>,