pub struct MicroReader { /* private fields */ }Expand description
MicroReader - DDS DataReader
Receives data samples from a topic.
§Design
- BEST_EFFORT QoS (no acknowledgments)
- No history cache (process immediately)
- Fixed-size receive buffer
§Example
ⓘ
let reader = MicroReader::new(
participant.guid_prefix(),
reader_entity_id,
"Temperature",
);
// Read sample
if let Some(sample) = reader.read(participant.transport_mut())? {
let mut decoder = CdrDecoder::new(sample.payload);
let temp: f32 = decoder.decode_f32()?;
let timestamp: i64 = decoder.decode_i64()?;
}Implementations§
Source§impl MicroReader
impl MicroReader
Sourcepub fn new(
guid_prefix: GuidPrefix,
entity_id: EntityId,
topic_name: &str,
) -> Result<Self>
pub fn new( guid_prefix: GuidPrefix, entity_id: EntityId, topic_name: &str, ) -> Result<Self>
Create a new reader
§Arguments
guid_prefix- Participant’s GUID prefixentity_id- Reader’s entity IDtopic_name- Topic name (max 63 chars)
Sourcepub fn topic_name(&self) -> &str
pub fn topic_name(&self) -> &str
Get topic name
Trait Implementations§
Source§impl Debug for MicroReader
impl Debug for MicroReader
Source§impl PartialEq for MicroReader
impl PartialEq for MicroReader
impl StructuralPartialEq for MicroReader
Auto Trait Implementations§
impl Freeze for MicroReader
impl RefUnwindSafe for MicroReader
impl Send for MicroReader
impl Sync for MicroReader
impl Unpin for MicroReader
impl UnsafeUnpin for MicroReader
impl UnwindSafe for MicroReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more