pub fn wait_for_acknowledgments(&self, _max_wait: Duration) -> Result<()> {
    match &self.qos_policy.reliability {
      Some(rel) => match rel {
        Reliability::BestEffort => return Ok(()),
        Reliability::Reliable {
          max_blocking_time: _,
        } =>
        // TODO: implement actual waiting for acks
        {
          ()
        }
      },
      None => return Ok(()),
    };

    // TODO: wait for actual acknowledgements to writers writes
    return Err(Error::Unsupported);
  }
/// Waits for all acknowledgements to finish
///
/// # Examples
///
/// ```
/// # use serde::{Serialize, Deserialize};
/// # use rustdds::dds::DomainParticipant;
/// # use rustdds::dds::qos::QosPolicyBuilder;
/// # use rustdds::dds::data_types::TopicKind;
/// # use rustdds::dds::With_Key_DataWriter as DataWriter;
/// # use rustdds::dds::traits::Keyed;
/// # use rustdds::serialization::CDRSerializerAdapter;
/// #
/// let domain_participant = DomainParticipant::new(0);
/// let qos = QosPolicyBuilder::new().build();
/// let publisher = domain_participant.create_publisher(&qos).unwrap();
///
/// #[derive(Serialize, Deserialize)]
/// struct SomeType { a: i32 }
/// impl Keyed for SomeType {
///   type K = i32;
///
///   fn get_key(&self) -> Self::K {
///     self.a
///   }
/// }
///
/// // WithKey is important
/// let topic = domain_participant.create_topic("some_topic", "SomeType", &qos, TopicKind::WithKey).unwrap();
/// let data_writer = publisher.create_datawriter::<SomeType, CDRSerializerAdapter<_>>(None, topic, None).unwrap();
///
/// let some_data = SomeType { a: 1 };
/// data_writer.write(some_data, None).unwrap();
/// data_writer.wait_for_acknowledgments(std::time::Duration::from_millis(100));
/// ```
Waits for all acknowledgements to finish
Waits for all acknowledgements to finish
pub fn wait_for_acknowledgments(&self, _max_wait: Duration) -> Result<()> {
    match &self.qos_policy.reliability {
      Some(rel) => match rel {
        Reliability::BestEffort => return Ok(()),
        Reliability::Reliable {
          max_blocking_time: _,
        } =>
        // TODO: implement actual waiting for acks
        {
          ()
        }
      },
      None => return Ok(()),
    };
    // TODO: wait for actual acknowledgements to writers writes
    return Err(Error::Unsupported);
  }
pub fn wait_for_acknowledgments ( & self , _max_wait : Duration ) -> Result < ( ) > { match & self . qos_policy . reliability { Some ( rel ) => match rel { Reliability :: BestEffort => return Ok ( ( ) ) , Reliability :: Reliable { max_blocking_time : _ , } => // TODO: implement actual waiting for acks { ( ) } } , None => return Ok ( ( ) ) , } ; // TODO: wait for actual acknowledgements to writers writes return Err ( Error :: Unsupported ) ; }
Waits for all acknowledgements to finish
Waits for all acknowledgements to finish
&self
_max_wait
Duration
examples
None
use serde::{serialize, deserialize};
None
use rustdds::dds::domainparticipant;
None
use rustdds::dds::qos::qospolicybuilder;
None
use rustdds::dds::data_types::topickind;
None
use rustdds::dds::with_key_datawriter as datawriter;
None
use rustdds::dds::traits::keyed;
None
use rustdds::serialization::cdrserializeradapter;
let domain_participant = DomainParticipant::new(0);
let qos = QosPolicyBuilder::new().build();
let publisher = domain_participant.create_publisher(&qos).unwrap().
let domain_participant = DomainParticipant :: new ( 0 ) ; let qos = QosPolicyBuilder :: new () . build () ; let publisher = domain_participant . create_publisher ( &qos ) . unwrap () .
[derive(serialize, deserialize)]
struct SomeType { a: i32 }
impl Keyed for SomeType {
type K = i32.



WithKey is important
let topic = domain_participant.create_topic("some_topic", "SomeType", &qos, TopicKind::WithKey).unwrap();
let data_writer = publisher.create_datawriter::>(None, topic, None).unwrap().

let some_data = SomeType { a: 1 };
data_writer.write(some_data, None).unwrap();
data_writer.wait_for_acknowledgments(std::time::Duration::from_millis(100));
```
struct SomeType { a : i32 } impl Keyed for SomeType { type K = i32 . WithKey is important let topic = domain_participant . create_topic ( " some_topic " " SomeType " &qos TopicKind :: WithKey ) . unwrap () ; let data_writer = publisher . create_datawriter :: > ( None topic None ) . unwrap () . let some_data = SomeType { a : 1 } ; data_writer . write ( some_data None ) . unwrap () ; data_writer . wait_for_acknowledgments ( std :: time :: Duration :: from_millis ( 100 )) ; ` ` `