Skip to main content

Publisher

Struct Publisher 

Source
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

Source

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.

Source

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.

Source

pub fn get_listener(&self) -> Option<Arc<dyn PublisherListener>>

Current listener clone, if present.

Source

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.

Source

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.

Source

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.

Source

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

Source

pub fn create_datawriter<T>( &self, topic: &Topic<T>, qos: DataWriterQos, ) -> Result<DataWriter<T>, DdsError>
where T: DdsType + Send + 'static,

Creates a typed DataWriter<T>. Spec §2.2.2.4.1.5 create_datawriter.

§Errors
  • BadParameter if topic.type_name() != T::TYPE_NAME (should be statically guaranteed, but we check defensively).

Trait Implementations§

Source§

impl Debug for Publisher

Source§

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

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

impl Entity for Publisher

Available on crate feature std only.
Source§

type Qos = PublisherQos

QoS type for this entity (e.g. DomainParticipantQos, DataWriterQos, …).
Source§

fn get_qos(&self) -> <Publisher as Entity>::Qos

Returns the current QoS (clone). Spec §2.2.2.1.2 get_qos.
Source§

fn set_qos(&self, qos: <Publisher as Entity>::Qos) -> Result<(), DdsError>

Changes the QoS. Before enable: everything allowed. After enable: only fields with “Changeable=YES” — otherwise an ImmutablePolicy error. Spec §2.2.2.1.2 set_qos. Read more
Source§

fn enable(&self) -> Result<(), DdsError>

Enables the entity (idempotent). Spec §2.2.2.1.4 enable. Read more
Source§

fn entity_state(&self) -> Arc<EntityState>

Internal accessor — each impl returns its Arc<EntityState>.
Source§

fn is_enabled(&self) -> bool

True if the entity is already enabled.
Source§

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

Bitmask of the status kinds changed since the last read. Spec §2.2.2.1.5 get_status_changes.
Source§

fn get_instance_handle(&self) -> InstanceHandle

Local 64-bit identifier. Spec §2.2.2.1.7 get_instance_handle.

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.