pub struct ParticipantConfig {
pub udp: UdpConfig,
pub announce_period: Duration,
pub lease_duration: Duration,
pub writer: WriterConfig,
pub reader: ReaderConfig,
pub drop_one_in: Option<u32>,
pub user_data: Vec<u8>,
pub shared_memory: bool,
pub user_multicast: bool,
pub persistence_directory: Option<PathBuf>,
}Expand description
Settings of a DomainParticipant.
Fields§
§udp: UdpConfigThe UDP settings: interfaces, port numbers, participant id.
announce_period: DurationHow often the participant announces itself (SPDP).
lease_duration: DurationHow long other participants keep this one without hearing from it (SPDP lease duration).
writer: WriterConfigThe timing of the user writers (HEARTBEAT period, NACK response delay, message size; DDSI-RTPS 2.5, 8.4.7.1).
reader: ReaderConfigThe timing of the reliable user readers (HEARTBEAT response delay, 8.4.10.1).
drop_one_in: Option<u32>For testing: drop user-traffic datagrams received (DATA,
HEARTBEAT, GAP, ACKNACK) at random, one in n on average, as if
they were lost on the way. None, the default, drops nothing.
user_data: Vec<u8>USER_DATA of the participant (DDS 1.4, 2.2.3.1): octets announced
to the other participants with SPDP. Empty by default. ROS 2
announces enclave=/; here.
Whether to exchange messages with the participants of rustorb-dds
on this host through shared memory rather than UDP (feature shm;
true by default). Others are reached by UDP either way.
user_multicast: boolWhether SPDP announces a defaultMulticastLocatorList (the
multicast group on the user multicast port), so that remote
writers may send user data to this participant’s readers by
multicast. False by default, as in Fast DDS: an implementation
that prefers multicast when it is offered (RustDDS) then sends
to one reader on this host through multicast loopback, in small
datagrams, at two to four times the round trip of unicast (#125).
persistence_directory: Option<PathBuf>The directory of the files in which PERSISTENT writers keep their
samples. None, the default, is the RUSTORB_DDS_PERSISTENCE_DIR
environment variable when it is set, and otherwise
rustorb-dds-persistent in the current directory. The property
Self::PERSISTENCE_DIRECTORY sets it too.
Implementations§
Source§impl ParticipantConfig
impl ParticipantConfig
Sourcepub const PERSISTENCE_DIRECTORY: &'static str = "rustorb.dds.persistence.directory"
pub const PERSISTENCE_DIRECTORY: &'static str = "rustorb.dds.persistence.directory"
The property that sets Self::persistence_directory.
Sourcepub fn new(domain_id: u32) -> Self
pub fn new(domain_id: u32) -> Self
The defaults for a domain: the system’s interfaces, the default ports, an announcement every 3 s and a lease of 20 s.
The announcement period is shorter than SPDP’s suggested 30 s so that participants find each other quickly in a small domain. Writers send a HEARTBEAT every 200 ms while some reliable reader has not acknowledged everything, and ask the readers to acknowledge every 16 samples and 1 ms after the last one, not each sample.
Sourcepub fn effective_persistence_directory(&self) -> PathBuf
pub fn effective_persistence_directory(&self) -> PathBuf
The directory of the files of PERSISTENT writers, as
Self::persistence_directory says.
Sourcepub fn localhost(domain_id: u32) -> Self
pub fn localhost(domain_id: u32) -> Self
Only this host: every socket on the loopback interface.
Sourcepub fn set_properties<'a>(
&mut self,
properties: impl IntoIterator<Item = (&'a str, &'a str)>,
) -> Result<()>
pub fn set_properties<'a>( &mut self, properties: impl IntoIterator<Item = (&'a str, &'a str)>, ) -> Result<()>
Takes the PROPERTY of a DomainParticipantQos (DDS Security 1.2,
7.2.5), as the bindings for other languages give it: the
dds.sec.* properties turn on DDS Security with the builtin
plugins (SecurityConfig::from_properties); the
dds.sec.crypto.rtps_psk_* ones and
dds.sec.access.rtps_psk_protection_kind set [Self::psk] (alone,
they choose the PSK plugins);
Self::PERSISTENCE_DIRECTORY sets
Self::persistence_directory; the others are ignored.
Fails with Error::Security when some but not all of the
dds.sec.auth.* and dds.sec.access.* properties are given, and
with Error::Unsupported when there are dds.sec.* properties
and the feature security is off.