Skip to main content

SubscribedRecipients

Struct SubscribedRecipients 

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

A Notification Forwarder’s Subscribed_Recipients: at most MAX_SUBSCRIBED_RECIPIENTS entries, each lapsing when its Time Remaining runs out. See the module documentation.

Implementations§

Source§

impl SubscribedRecipients

Source

pub fn new() -> Self

An empty list.

Source

pub fn subscriptions(&self) -> Vec<BACnetEventNotificationSubscription>

The live entries in list order, each with the whole minutes it has left, rounded up.

Source

pub fn read(&self) -> PropertyValue

The property value: the live entries, encoded back to back in PropertyValue::ApplicationData.

Source

pub fn write(&mut self, value: PropertyValue) -> Result<(), Error>

Replace the list with a written one, all or nothing.

Only the framed form in PropertyValue::ApplicationData is a value; anything else, or an entry that does not decode, fails with PROPERTY / INVALID_DATA_TYPE. An entry whose Time Remaining is 0 or past MAX_SUBSCRIPTION_MINUTES fails with PROPERTY / VALUE_OUT_OF_RANGE, and the first entry past MAX_SUBSCRIBED_RECIPIENTS with RESOURCES / NO_SPACE_TO_WRITE_PROPERTY; both name the entry’s position in the written list.

Each entry’s Time Remaining starts its lifetime over, except that an entry written as it reads now keeps its deadline, and so does one written with a minute more, which is how it read if a minute boundary fell between the read and this write. A list read and written back, or edited by the list services, so leaves the entries it doesn’t change alone, rather than stretching each to its rounded-up minute. Two entries naming the same recipient and process are one entry, which takes the later one’s members.

Source

pub fn bind_monotonic_clock(&mut self, clock: Option<Arc<MonotonicClock>>)

Bind the database’s monotonic clock, from the object’s bind_monotonic_clock_internal. Each held entry keeps the time it has left: its deadline moves from the old time base to the new one, so a list written or restored before the object joins a database lapses on time.

Source

pub fn advance_to(&mut self, now: Duration) -> bool

Drop every entry whose deadline is at or before now, a monotonic instant, from the object’s advance_monotonic_time_internal. true when one was dropped.

Source

pub fn advance_by(&mut self, elapsed: Duration) -> bool

Count elapsed on a store with no bound clock, then drop what has lapsed, as Self::advance_to does. true when an entry was dropped.

Source

pub fn next_deadline(&self) -> Option<Duration>

The earliest deadline among the held entries, for the object’s next_monotonic_deadline_internal.

Trait Implementations§

Source§

impl Clone for SubscribedRecipients

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubscribedRecipients

Source§

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

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

impl Default for SubscribedRecipients

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more