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