Struct rustdds::SampleInfo[][src]

pub struct SampleInfo {
    pub sample_state: SampleState,
    pub view_state: ViewState,
    pub instance_state: InstanceState,
    pub generation_counts: NotAliveGenerationCounts,
    pub sample_rank: i32,
    pub generation_rank: i32,
    pub absolute_generation_rank: i32,
    pub source_timestamp: Option<Timestamp>,
    pub publication_handle: GUID,
}
Expand description

SampleInfo is metadata attached to each received data sample. It exists only at the receiving end of DDS, and is (mostly) generated by DDS.

Some of the SampleInfo field description texts are quoted from the DDS Specification.

Fields

sample_state: SampleState

sample_state indicates whether or not the corresponding data sample has already been read through this DataReader.

view_state: ViewState

Indicates that either this is the first time that the DataReader has ever accessed samples of that instance, or else that the DataReader has accessed previous samples of the instance, but the instance has since been reborn (i.e., become not-alive and then alive again).

instance_state: InstanceState

Indicates whether this instance is alive or not. The instance can be not alive either because some writer has actively disposed it, or there are no writers alive.

generation_counts: NotAliveGenerationCounts

For each instance the middleware internally maintains these counts relative to each DataReader. The counts capture snapshots of the corresponding counters at the time the sample was received.

sample_rank: i32

The ranks are are computed based solely on the actual samples in the ordered collection returned by the read or take. The sample_rank indicates the number of samples of the same instance that follow the current one in the collection.

generation_rank: i32

The generation_rank indicates the difference in generations between the samples S and the Most Recent Sample of the same instance that appears In the returned Collection (MRSIC). It counts the number of times the instance transitioned from not-alive to alive in the time from the reception of the S to the reception of MRSIC. The generation rank is computed with: generation_rank = (MRSIC.disposed_generation_count + MRSIC.no_writers_generation_count) – (S.disposed_generation_count + S.no_writers_generation_count)

absolute_generation_rank: i32

The absolute_generation_rank indicates the difference in “generations” between sample S and the Most Recent Sample of the instance that the middlware has received (MRS). It counts the number of times the instance transitioned from not-alive to alive in the time from the reception of the S to the time when the read or take was called. absolute_generation_rank = (MRS.disposed_generation_count + MRS.no_writers_generation_count) – (S.disposed_generation_count + S.no_writers_generation_count)

source_timestamp: Option<Timestamp>

Source timestamp is the timestamp that was supplied by the DataWriter that sent this sample. It is optional to timestamp samples when writing.

publication_handle: GUID

publication_handle identifies the DataWriter that modified the instance (i.e. wrote this sample)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.