Skip to main content

AsyncDataWriter

Struct AsyncDataWriter 

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

Async-Wrapper um DataWriter<T>.

Hot-Path: write() ist eine Future-Form ueber dem sync-Pfad mit einer yield-basierten Retry-Schleife fuer OutOfResources-Backpressure (Spec §5.1 zerodds-async-1.0). Statt eines Thread-Block-Condvar::wait_timeout fallen Caller-Tasks per yield_for aus dem Executor und bleiben cancelable. Andere DCPS-Methoden delegieren synchron — sie sind ohnehin nicht blockierend.

Implementations§

Source§

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

Source

pub async fn write(&self, sample: &T) -> Result<()>
where T: Clone,

Schreibt einen Sample. Spec §2.1.1.

§Errors

Wie DataWriter::writeOutOfResources nach max_blocking_time-Timeout, sonst alle anderen Errors transparent durchgereicht.

Spec §5.1 zerodds-async-1.0: bei OutOfResources suspendiert der Future via yield_for und retried, bis entweder ein Drain passiert oder die reliability.max_blocking_time abgelaufen ist. Im Sync-Pfad wuerde hier ein Condvar::wait_timeout blockieren — async-Pfad nutzt yield-retry-Loop ohne Thread-Block.

Source

pub async fn register_instance(&self, sample: &T) -> Result<InstanceHandle>

Spec §2.1.2 register_instance.

§Errors

Wie sync.

Source

pub async fn dispose(&self, sample: &T, handle: InstanceHandle) -> Result<()>

Spec §2.1.3 dispose. Loest Wire-Lifecycle DISPOSED.

§Errors

Wie sync.

Source

pub async fn unregister_instance( &self, sample: &T, handle: InstanceHandle, ) -> Result<()>

Spec §2.1.4 unregister_instance.

§Errors

Wie sync.

Source

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

Spec §2.1.5 wait_for_matched_subscription. Async-Polling- Schleife mit 10 ms Tick.

§Errors

Wie sync — Timeout wenn min_count nicht in timeout erreicht.

Source

pub fn matched_subscription_count(&self) -> usize

Spec §2.1.6 matched_subscription_count (synchron).

Source

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

Liefert die zugrundeliegende sync-Variante.

Source

pub fn qos(&self) -> DataWriterQos

Liefert die DataWriterQos.

Trait Implementations§

Source§

impl<T: DdsType + Send + Sync + 'static> Clone for AsyncDataWriter<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.