Skip to main content

AsyncDataReader

Struct AsyncDataReader 

Source
pub struct AsyncDataReader<T: DdsType + Send + Sync + 'static> { /* private fields */ }
Expand description

Async-Wrapper um DataReader<T>.

Implementations§

Source§

impl<T: DdsType + Send + Sync + 'static> AsyncDataReader<T>

Source

pub fn take_stream(&self) -> SampleStream<T>

Spec §2.2.1 take_streamStream<Item = T>.

Live-Mode (Reader hat runtime_handle()): der Stream registriert sich mit register_user_reader_waker an der Runtime; cx.waker() wird beim naechsten Sample-Zufluss gefeuert (kein Polling). Offline-Mode: detached-Thread-Sleep als Polling-Fallback (Spec §3.3).

Source

pub async fn take(&self, timeout: Duration) -> Result<Vec<T>>

Spec §2.2.2 take(timeout). Resolves Ok mit Vec<T> wenn Samples verfuegbar sind oder Timeout abgelaufen ist (dann leerer Vec statt Err — analog take() sync).

§Errors

Wire-/Decode-Fehler wie sync.

Source

pub async fn wait_for_matched_publication( &self, min_count: usize, timeout: Duration, ) -> Result<()>

Spec §2.2.3 wait_for_matched_publication.

§Errors

Timeout wenn min_count nicht erreicht.

Source

pub fn matched_publication_count(&self) -> usize

Spec §2.2.4 matched_publication_count (synchron).

Source

pub fn as_sync(&self) -> &DataReader<T>

Liefert die zugrundeliegende sync-Variante.

Source

pub fn qos(&self) -> DataReaderQos

Liefert die DataReaderQos.

Source

pub fn data_available_stream(&self) -> DataAvailableStream<T>

Spec §6.1 data_available_streamStream<Item = ()>. Emittiert pro Sample-Zufluss ein ()-Event; Caller ruft danach take() / iteriert ueber take_stream() um die Samples zu holen. Konsumiert keine Samples (im Gegensatz zu Self::take_stream).

Live-Mode: registriert sich am Reader-Slot der Runtime (register_user_reader_waker) — Wake erfolgt beim sample_tx.send durch die Runtime, kein Polling. Offline- Mode: detached-Thread-Sleep als Polling-Fallback.

Source

pub fn publication_matched_stream(&self) -> PublicationMatchedStream<T>

Spec §6.2 publication_matched_streamStream<Item = SubscriptionMatchedStatus>. Emittiert den vollen Reader-side Match-Status (DDS 1.4 §2.2.4.1 SUBSCRIPTION_MATCHED) jedes Mal wenn sich der Count an matched Publications (Writers) aendert. Felder: total_count (cumulative), total_count_change (delta), current_count (currently matched), current_count_change (signed delta), last_publication_handle.

Trait Implementations§

Source§

impl<T: DdsType + Send + Sync + 'static> Clone for AsyncDataReader<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.