pub struct DomainParticipant { /* private fields */ }
Expand description

DDS DomainParticipant

It is recommended that only one DomainParticipant per OS process is created, as it allocates network sockets, creates background threads, and allocates some memory for object caches.

If you need to communicate to many DDS domains, then you must create a separate DomainParticipant for each of them. See DDS Spec v1.4 Section “2.2.1.2.2 Overall Conceptual Model” and “2.2.2.2.1 DomainParticipant Class” for a definition of a (DDS) domain. Domains are identified by a domain identifier, which is, in Rust terms, a u16. Domain identifier values are application-specific, but 0 is usually the default.

Implementations

Examples

let domain_participant = DomainParticipant::new(0).unwrap();

Creates DDS Publisher

Arguments
  • qos - Takes qos policies for publisher and given to DataWriter as default.
Examples

let domain_participant = DomainParticipant::new(0).unwrap();
let qos = QosPolicyBuilder::new().build();
let publisher = domain_participant.create_publisher(&qos);

Creates DDS Subscriber

Arguments
  • qos - Takes qos policies for subscriber and given to DataReader as default.
Examples

let domain_participant = DomainParticipant::new(0).unwrap();
let qos = QosPolicyBuilder::new().build();
let subscriber = domain_participant.create_subscriber(&qos);

Create DDS Topic

Arguments
  • name - Name of the topic.
  • type_desc - Name of the type this topic is supposed to deliver.
  • qos - Takes qos policies that are distributed to DataReaders and DataWriters.
Examples

let domain_participant = DomainParticipant::new(0).unwrap();
let qos = QosPolicyBuilder::new().build();
let topic = domain_participant.create_topic("some_topic".to_string(), "SomeType".to_string(), &qos, TopicKind::WithKey);
Examples

let domain_participant = DomainParticipant::new(0).unwrap();
let domain_id = domain_participant.domain_id();
Examples

let domain_participant = DomainParticipant::new(0).unwrap();
let participant_id = domain_participant.participant_id();

Gets all DiscoveredTopics from DDS network

Examples

let domain_participant = DomainParticipant::new(0).unwrap();
let discovered_topics = domain_participant.discovered_topics();
for dtopic in discovered_topics.iter() {
  // do something
}

Manually asserts liveliness, affecting all writers with LIVELINESS QoS of MANUAL_BY_PARTICIPANT created by this particular participant.

Example

let domain_participant = DomainParticipant::new(0).expect("Failed to create participant");
domain_participant.assert_liveliness();

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.