Struct rustdds::DomainParticipant

source ·
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§

source§

impl DomainParticipant

source

pub fn new(domain_id: u16) -> CreateResult<Self>

§Examples

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

pub fn create_publisher(&self, qos: &QosPolicies) -> CreateResult<Publisher>

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);
source

pub fn create_subscriber(&self, qos: &QosPolicies) -> CreateResult<Subscriber>

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);
source

pub fn create_topic( &self, name: String, type_desc: String, qos: &QosPolicies, topic_kind: TopicKind ) -> CreateResult<Topic>

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);
source

pub fn find_topic( &self, name: &str, timeout: Duration ) -> CreateResult<Option<Topic>>

source

pub fn domain_id(&self) -> u16

§Examples

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

pub fn participant_id(&self) -> u16

§Examples

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

pub fn discovered_topics(&self) -> Vec<DiscoveredTopicData>

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
}
source

pub fn assert_liveliness(&self) -> WriteResult<(), ()>

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();
source

pub fn status_listener(&self) -> DomainParticipantStatusListener

Get a DomainDomainParticipantStatusListener that can be used to get DomainParticipantStatusEvents for this DomainParticipant.

Trait Implementations§

source§

impl Clone for DomainParticipant

source§

fn clone(&self) -> DomainParticipant

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for DomainParticipant

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for DomainParticipant

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl RTPSEntity for DomainParticipant

source§

fn guid(&self) -> GUID

source§

fn entity_id(&self) -> EntityId

source§

fn guid_prefix(&self) -> GuidPrefix

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> 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,

§

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>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V