Skip to main content

ProcessSnapshot

Struct ProcessSnapshot 

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

Snapshot of changes from a process cycle, used for notify outside lock.

The first post is held inline and the rest spill to a Vec, the same shape as ProcStack and for the same reason: the overwhelmingly common cycle posts exactly one field — the record’s deadband-tracked value, with nothing subscribed behind it — and a Vec charged that cycle a 256-byte allocation and its free. It was the last per-cycle allocation on the process path.

head and rest carry no meaning of their own: head is post 0 and rest is posts 1.., so nothing may read them apart from Self::iter.

Implementations§

Source§

impl ProcessSnapshot

Source

pub fn new() -> Self

A cycle that posted nothing.

Source

pub fn push(&mut self, post: (Cow<'static, str>, EpicsValue, EventMask))

Add one post, after every post already added.

Source

pub fn is_empty(&self) -> bool

Whether this cycle posted nothing at all.

Source

pub fn len(&self) -> usize

How many fields this cycle posts.

Source

pub fn iter( &self, ) -> impl Iterator<Item = &(Cow<'static, str>, EpicsValue, EventMask)>

The cycle’s posts, in the order they were added.

Source

pub fn retain( &mut self, keep: impl FnMut(&(Cow<'static, str>, EpicsValue, EventMask)) -> bool, )

Keep only the posts keep accepts; keep sees every post once, in the order they were added.

Source

pub fn published_mask(&self) -> EventMask

The union of every DBE_* class this cycle actually published — the port’s answer to “what did db_post_events send for this record”.

A field carrying an empty mask is not posted at all (RecordInstance::notify_from_snapshot skips it), so an empty union means the cycle published nothing and no monitor of any class fired.

Trait Implementations§

Source§

impl Default for ProcessSnapshot

Source§

fn default() -> Self

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

impl Extend<(Cow<'static, str>, EpicsValue, EventMask)> for ProcessSnapshot

Source§

fn extend<I: IntoIterator<Item = (Cow<'static, str>, EpicsValue, EventMask)>>( &mut self, iter: I, )

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: T)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl FromIterator<(Cow<'static, str>, EpicsValue, EventMask)> for ProcessSnapshot

Source§

fn from_iter<I: IntoIterator<Item = (Cow<'static, str>, EpicsValue, EventMask)>>( iter: I, ) -> Self

Creates a value from an iterator. 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> 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, 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