Skip to main content

Topic

Struct Topic 

Source
pub struct Topic<T>
where T: DdsType,
{ /* private fields */ }
Expand description

Typed topic handle.

Implementations§

Source§

impl<T> Topic<T>
where T: DdsType,

Source

pub fn new( name: String, qos: TopicQos, participant: DomainParticipant, ) -> Topic<T>

Creates a new topic handle. Normally called by DomainParticipant::create_topic<T>(name, qos).

Source

pub fn new_orphan(name: String, qos: TopicQos) -> Topic<T>

Creates a topic handle without a participant — for builtin topics (DCPSParticipant/Topic/Publication/Subscription) that are created in the BuiltinSubscriber constructor before the DomainParticipant is ready (chicken-and-egg problem). get_participant() panics on an orphan topic — builtin readers avoid it.

Source

pub fn name(&self) -> &str

Topic name.

Source

pub fn type_name(&self) -> &'static str

Type name (from T::TYPE_NAME).

Source

pub fn set_listener(&self, listener: Option<Arc<dyn TopicListener>>, mask: u32)

Sets the TopicListener + StatusMask. None clears the slot. Spec §2.2.2.3.2.x set_listener.

Source

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

Current listener clone, if any.

Source

pub fn record_inconsistent_topic(&self)

Records an InconsistentTopic detection (e.g. when a remote topic with the same name but a different type name is discovered, or when create_topic is called with the same name but a different type). Spec §2.2.4.2.5.

Source

pub fn inconsistent_topic_status(&self) -> InconsistentTopicStatus

Current InconsistentTopicStatus + trigger via bubble-up on a delta versus the last call.

Source

pub fn qos(&self) -> TopicQos

Topic QoS (cloned). The inner mutex allows set_qos.

Trait Implementations§

Source§

impl<T> Clone for Topic<T>
where T: DdsType,

Source§

fn clone(&self) -> Topic<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Topic<T>
where T: Debug + DdsType,

Source§

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

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

impl<T> Entity for Topic<T>
where T: DdsType,

Available on crate feature std only.
Source§

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

TopicQos. Spec §2.2.3: all topic policies (TOPIC_DATA, DURABILITY, RELIABILITY, HISTORY, RESOURCE_LIMITS, …) are immutable after enable() — only TOPIC_DATA is Changeable=YES.

Source§

type Qos = TopicQos

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

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

Returns the current QoS (clone). Spec §2.2.2.1.2 get_qos.
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.
Source§

impl<T> TopicDescription for Topic<T>
where T: DdsType,

Source§

fn get_participant(&self) -> &DomainParticipant

Returns the owning participant. Panics on builtin (orphan) topics constructed via Topic::new_orphan — builtin readers do not call get_participant().

Source§

fn get_type_name(&self) -> &str

Type name (e.g. "std_msgs::msg::String"). Spec §2.2.2.3.1 get_type_name.
Source§

fn get_name(&self) -> &str

Topic name (e.g. "ChatterTopic"). Spec §2.2.2.3.1 get_name.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Topic<T>

§

impl<T> !UnwindSafe for Topic<T>

§

impl<T> Freeze for Topic<T>

§

impl<T> Send for Topic<T>
where T: Send,

§

impl<T> Sync for Topic<T>
where T: Sync,

§

impl<T> Unpin for Topic<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Topic<T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.