Skip to main content

DomainParticipantFactory

Struct DomainParticipantFactory 

Source
pub struct DomainParticipantFactory { /* private fields */ }
Expand description

Factory singleton.

Implementations§

Source§

impl DomainParticipantFactory

Source

pub fn instance() -> &'static Self

Returns the process-wide factory singleton (Spec §2.2.2.2.2.1 get_instance).

Source

pub fn create_participant( &self, domain_id: DomainId, qos: DomainParticipantQos, ) -> Result<DomainParticipant>

Creates a new DomainParticipant for the given domain id. Starts the DcpsRuntime with the default config — UDP sockets + SPDP/SEDP threads.

§Errors

DdsError::TransportError if the UDP sockets do not bind.

Source

pub fn create_participant_with_config( &self, domain_id: DomainId, qos: DomainParticipantQos, config: RuntimeConfig, ) -> Result<DomainParticipant>

Variant with an explicitly passed RuntimeConfig (e.g. for tests with short SPDP periods).

§Errors

DdsError::TransportError if the UDP sockets do not bind.

Source

pub fn create_participant_offline( &self, domain_id: DomainId, qos: DomainParticipantQos, ) -> DomainParticipant

Offline variant without a runtime — only for unit tests that don’t want a network. The returned participant can create topics, but no DataWriters/Readers.

Source

pub fn lookup_participant( &self, domain_id: DomainId, ) -> Option<DomainParticipant>

Spec §2.2.2.2.2.4 lookup_participant(domain_id) — returns a previously created participant for the same domain id, or None if none is registered. With several participants for the same domain, the implementation returns the first.

Source

pub fn delete_participant(&self, p: &DomainParticipant) -> Result<()>

Spec §2.2.2.2.2.3 delete_participant. Removes the participant from the factory registry and calls delete_contained_entities. Returns PreconditionNotMet if the participant is not in the registry.

§Errors

DdsError::PreconditionNotMet if the participant is not registered.

Source

pub fn set_default_participant_qos( &self, qos: DomainParticipantQos, ) -> Result<()>

Spec §2.2.2.2.2.5 set_default_participant_qos — default QoS for participants created from now on.

§Errors

DdsError::PreconditionNotMet on lock poisoning.

Source

pub fn get_default_participant_qos(&self) -> DomainParticipantQos

Spec §2.2.2.2.2.5 get_default_participant_qos.

Source

pub fn set_qos(&self, qos: DomainParticipantFactoryQos) -> Result<()>

Spec §2.2.2.2.2.6 set_qos (factory-level QoS).

§Errors

DdsError::PreconditionNotMet on lock poisoning.

Source

pub fn get_qos(&self) -> DomainParticipantFactoryQos

Spec §2.2.2.2.2.6 get_qos (factory-level QoS).

Source

pub fn create(domain_id: DomainId) -> ParticipantBuilder

Fluent entry point for creating a participant: returns a ParticipantBuilder that collects QoS, a custom RuntimeConfig, and (with the security feature) a SecurityBundle, then materializes the participant on ParticipantBuilder::build.

This is a convenience facade over Self::create_participant_with_configbuild() resolves to the same live runtime path. It exists so security wiring reads as one chain:

use zerodds_dcps::DomainParticipantFactory;
let participant = DomainParticipantFactory::create(0)
    .with_security(security_bundle)
    .build()?;

Trait Implementations§

Source§

impl Debug for DomainParticipantFactory

Source§

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

Formats the value using the given formatter. 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> 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, 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.