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
impl ProcessSnapshot
Sourcepub fn push(&mut self, post: (Cow<'static, str>, EpicsValue, EventMask))
pub fn push(&mut self, post: (Cow<'static, str>, EpicsValue, EventMask))
Add one post, after every post already added.
Sourcepub fn iter(
&self,
) -> impl Iterator<Item = &(Cow<'static, str>, EpicsValue, EventMask)>
pub fn iter( &self, ) -> impl Iterator<Item = &(Cow<'static, str>, EpicsValue, EventMask)>
The cycle’s posts, in the order they were added.
Sourcepub fn retain(
&mut self,
keep: impl FnMut(&(Cow<'static, str>, EpicsValue, EventMask)) -> bool,
)
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.
Sourcepub fn published_mask(&self) -> EventMask
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
impl Default for ProcessSnapshot
Source§impl Extend<(Cow<'static, str>, EpicsValue, EventMask)> for ProcessSnapshot
impl Extend<(Cow<'static, str>, EpicsValue, EventMask)> for ProcessSnapshot
Source§fn extend<I: IntoIterator<Item = (Cow<'static, str>, EpicsValue, EventMask)>>(
&mut self,
iter: I,
)
fn extend<I: IntoIterator<Item = (Cow<'static, str>, EpicsValue, EventMask)>>( &mut self, iter: I, )
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)