pub struct Publisher { /* private fields */ }Expand description
Publisher — entity group for DataWriters.
In DDS 1.4 the publisher has its own QoS (Partition, GroupData, Presentation). v1.2 implements only the API shape without partition matching.
Implementations§
Source§impl Publisher
impl Publisher
Sourcepub fn contains_writer(&self, handle: InstanceHandle) -> bool
pub fn contains_writer(&self, handle: InstanceHandle) -> bool
Spec §2.2.2.2.1.10 — true if handle is a DataWriter created
through this publisher.
Sourcepub fn set_listener(
&self,
listener: Option<Arc<dyn PublisherListener>>,
mask: u32,
)
pub fn set_listener( &self, listener: Option<Arc<dyn PublisherListener>>, mask: u32, )
Sets the PublisherListener + StatusMask. None clears the slot.
Spec §2.2.2.4.3.x.
Sourcepub fn get_listener(&self) -> Option<Arc<dyn PublisherListener>>
pub fn get_listener(&self) -> Option<Arc<dyn PublisherListener>>
Current listener clone, if present.
Sourcepub fn suspend_publications(&self)
pub fn suspend_publications(&self)
Spec §2.2.2.4.1.10 suspend_publications — a hint to the Service
that subsequent write() calls may be buffered (e.g. for
coalescing). Has no mandatory semantics for the caller; the flag
is readable via is_suspended() for the writer implementation.
Idempotent: a second suspend_publications() without a
resume_publications() in between is allowed.
Sourcepub fn resume_publications(&self)
pub fn resume_publications(&self)
Spec §2.2.2.4.1.11 resume_publications — counterpart to
suspend_publications. With the suspend flag active the behavior
is “Service can stop coalescing”; with the flag inactive it is a
no-op.
Sourcepub fn is_suspended(&self) -> bool
pub fn is_suspended(&self) -> bool
true if suspend_publications() is active and
resume_publications() has not yet been called. Read by the
writer send path as a coalescing hint.
Sourcepub fn copy_from_topic_qos(
dw_qos: &mut DataWriterQos,
topic_qos: &TopicQos,
) -> Result<(), DdsError>
pub fn copy_from_topic_qos( dw_qos: &mut DataWriterQos, topic_qos: &TopicQos, ) -> Result<(), DdsError>
Spec §2.2.2.4.1.13 copy_from_topic_qos — copies the policies
shareable between topic and DataWriter QoS from topic_qos into
dw_qos. The spec’s list of common policies (DCPS 1.4
§2.2.2.4.1.13): DURABILITY, DEADLINE, LATENCY_BUDGET, LIVELINESS,
RELIABILITY, DESTINATION_ORDER, HISTORY, RESOURCE_LIMITS,
TRANSPORT_PRIORITY, LIFESPAN, OWNERSHIP.
§Errors
DdsError::BadParameter if the result yields an inconsistent QoS
combination — validated by the caller DataWriter’s
QoS-compatibility check (analogous to set_qos).
Sourcepub fn create_datawriter<T>(
&self,
topic: &Topic<T>,
qos: DataWriterQos,
) -> Result<DataWriter<T>, DdsError>
pub fn create_datawriter<T>( &self, topic: &Topic<T>, qos: DataWriterQos, ) -> Result<DataWriter<T>, DdsError>
Creates a typed DataWriter<T>. Spec §2.2.2.4.1.5
create_datawriter.
§Errors
BadParameteriftopic.type_name() != T::TYPE_NAME(should be statically guaranteed, but we check defensively).
Trait Implementations§
Source§impl Entity for Publisher
Available on crate feature std only.
impl Entity for Publisher
std only.Source§type Qos = PublisherQos
type Qos = PublisherQos
DomainParticipantQos,
DataWriterQos, …).Source§fn get_qos(&self) -> <Publisher as Entity>::Qos
fn get_qos(&self) -> <Publisher as Entity>::Qos
get_qos.Source§fn set_qos(&self, qos: <Publisher as Entity>::Qos) -> Result<(), DdsError>
fn set_qos(&self, qos: <Publisher as Entity>::Qos) -> Result<(), DdsError>
ImmutablePolicy error. Spec §2.2.2.1.2 set_qos. Read moreSource§fn enable(&self) -> Result<(), DdsError>
fn enable(&self) -> Result<(), DdsError>
enable. Read moreSource§fn entity_state(&self) -> Arc<EntityState>
fn entity_state(&self) -> Arc<EntityState>
Arc<EntityState>.Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Source§fn get_status_condition(&self) -> StatusCondition
fn get_status_condition(&self) -> StatusCondition
StatusCondition of this entity.
Spec §2.2.2.1.6 get_status_condition.Source§fn get_status_changes(&self) -> u32
fn get_status_changes(&self) -> u32
get_status_changes.Source§fn get_instance_handle(&self) -> InstanceHandle
fn get_instance_handle(&self) -> InstanceHandle
get_instance_handle.