pub struct Topic<T: DdsType> { /* private fields */ }Expand description
Typed topic handle.
Implementations§
Source§impl<T: DdsType> Topic<T>
impl<T: DdsType> Topic<T>
Sourcepub fn new(name: String, qos: TopicQos, participant: DomainParticipant) -> Self
pub fn new(name: String, qos: TopicQos, participant: DomainParticipant) -> Self
Creates a new topic handle. Normally called by
DomainParticipant::create_topic<T>(name, qos).
Sourcepub fn new_orphan(name: String, qos: TopicQos) -> Self
pub fn new_orphan(name: String, qos: TopicQos) -> Self
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<ArcTopicListener>, mask: StatusMask)
pub fn set_listener(&self, listener: Option<ArcTopicListener>, mask: StatusMask)
Sets the TopicListener + StatusMask. None clears the slot.
Spec §2.2.2.3.2.x set_listener.
Sourcepub fn get_listener(&self) -> Option<ArcTopicListener>
pub fn get_listener(&self) -> Option<ArcTopicListener>
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: DdsType> Entity for Topic<T>
Available on crate feature std only.
impl<T: DdsType> Entity for Topic<T>
std only.Source§fn set_qos(&self, qos: Self::Qos) -> Result<()>
fn set_qos(&self, qos: Self::Qos) -> Result<()>
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 enable(&self) -> Result<()>
fn enable(&self) -> Result<()>
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) -> StatusMask
fn get_status_changes(&self) -> StatusMask
get_status_changes.Source§fn get_instance_handle(&self) -> InstanceHandle
fn get_instance_handle(&self) -> InstanceHandle
get_instance_handle.Source§impl<T: DdsType> TopicDescription for Topic<T>
impl<T: DdsType> TopicDescription for Topic<T>
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.