pub struct Topic<T>where
T: DdsType,{ /* private fields */ }Expand description
Typed topic handle.
Implementations§
Source§impl<T> Topic<T>where
T: DdsType,
impl<T> Topic<T>where
T: DdsType,
Sourcepub fn new(
name: String,
qos: TopicQos,
participant: DomainParticipant,
) -> Topic<T>
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).
Sourcepub fn new_orphan(name: String, qos: TopicQos) -> Topic<T>
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.
Sourcepub fn set_listener(&self, listener: Option<Arc<dyn TopicListener>>, mask: u32)
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.
Sourcepub fn get_listener(&self) -> Option<Arc<dyn TopicListener>>
pub fn get_listener(&self) -> Option<Arc<dyn TopicListener>>
Current listener clone, if any.
Sourcepub fn record_inconsistent_topic(&self)
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.
Sourcepub fn inconsistent_topic_status(&self) -> InconsistentTopicStatus
pub fn inconsistent_topic_status(&self) -> InconsistentTopicStatus
Current InconsistentTopicStatus + trigger via bubble-up on a
delta versus the last call.
Trait Implementations§
Source§impl<T> Entity for Topic<T>where
T: DdsType,
Available on crate feature std only.
impl<T> Entity for Topic<T>where
T: DdsType,
std only.Source§fn set_qos(&self, qos: <Topic<T> as Entity>::Qos) -> Result<(), DdsError>
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§fn get_qos(&self) -> <Topic<T> as Entity>::Qos
fn get_qos(&self) -> <Topic<T> as Entity>::Qos
get_qos.Source§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.Source§impl<T> TopicDescription for Topic<T>where
T: DdsType,
impl<T> TopicDescription for Topic<T>where
T: DdsType,
Source§fn get_participant(&self) -> &DomainParticipant
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
fn get_type_name(&self) -> &str
"std_msgs::msg::String").
Spec §2.2.2.3.1 get_type_name.