pub struct SampleInfo {
pub sample_state: SampleStateKind,
pub view_state: ViewStateKind,
pub instance_state: InstanceStateKind,
pub disposed_generation_count: i32,
pub no_writers_generation_count: i32,
pub sample_rank: i32,
pub generation_rank: i32,
pub absolute_generation_rank: i32,
pub source_timestamp: Time,
pub instance_handle: InstanceHandle,
pub publication_handle: InstanceHandle,
pub valid_data: bool,
}Expand description
SampleInfo (DDS 1.4 §2.2.2.5.1) — per-sample metadata.
Filled by the DataReader in the take/read path. Application
code is meant to rely on these fields to:
- distinguish new samples from re-read ones (
sample_state), - detect new instances (
view_state == NEW), - observe lifecycle events (
instance_state,valid_data == false), - follow reordering / generation changes (
*_generation_count,*_rank).
Fields§
§sample_state: SampleStateKindSample-State (READ / NOT_READ).
view_state: ViewStateKindView-State (NEW / NOT_NEW).
instance_state: InstanceStateKindInstance-State (ALIVE / NOT_ALIVE_*).
disposed_generation_count: i32How many times the instance has gone through NOT_ALIVE_DISPOSED → ALIVE
since its first sample.
no_writers_generation_count: i32How many times the instance has gone through NOT_ALIVE_NO_WRITERS → ALIVE
since its first sample.
sample_rank: i32Number of samples in the same instance that follow this one in the cache (§2.2.2.5.1.5).
generation_rank: i32Difference in generation_count between this sample and the last
sample of the instance in the same read set.
absolute_generation_rank: i32Difference in generation_count between this sample and the
current generation count.
source_timestamp: TimeWall-clock time of the write/dispose/unregister.
instance_handle: InstanceHandleLocal handle of the instance.
publication_handle: InstanceHandleLocal handle of the sending DataWriter (HANDLE_NIL in the
offline / unknown case).
valid_data: booltrue if the sample carries payload; false for a plain
dispose/unregister marker (§2.2.2.5.1.13).
Implementations§
Source§impl SampleInfo
impl SampleInfo
Sourcepub fn new_alive(
instance: InstanceHandle,
publication: InstanceHandle,
timestamp: Time,
) -> Self
pub fn new_alive( instance: InstanceHandle, publication: InstanceHandle, timestamp: Time, ) -> Self
Constructs a default info block for a fresh sample of a new
instance with valid_data = true.
Trait Implementations§
Source§impl Clone for SampleInfo
impl Clone for SampleInfo
Source§fn clone(&self) -> SampleInfo
fn clone(&self) -> SampleInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SampleInfo
Source§impl Debug for SampleInfo
impl Debug for SampleInfo
Source§impl Default for SampleInfo
impl Default for SampleInfo
impl Eq for SampleInfo
Source§impl PartialEq for SampleInfo
impl PartialEq for SampleInfo
Source§fn eq(&self, other: &SampleInfo) -> bool
fn eq(&self, other: &SampleInfo) -> bool
self and other values to be equal, and is used by ==.