Skip to main content

Entity

Trait Entity 

Source
pub trait Entity {
    type Qos: Clone;

    // Required methods
    fn get_qos(&self) -> Self::Qos;
    fn set_qos(&self, qos: Self::Qos) -> Result<()>;
    fn enable(&self) -> Result<()>;
    fn entity_state(&self) -> Arc<EntityState> ;

    // Provided methods
    fn is_enabled(&self) -> bool { ... }
    fn get_status_condition(&self) -> StatusCondition { ... }
    fn get_status_changes(&self) -> StatusMask { ... }
    fn get_instance_handle(&self) -> InstanceHandle { ... }
}
Expand description

Entity trait — common lifecycle API of the 6 entity types (DCPS §2.2.2.1).

Non-blocking, Send+Sync — all methods delegate to Arc<EntityState>.

Required Associated Types§

Source

type Qos: Clone

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

Required Methods§

Source

fn get_qos(&self) -> Self::Qos

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

Source

fn set_qos(&self, qos: Self::Qos) -> Result<()>

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.

§Errors
Source

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

Enables the entity (idempotent). Spec §2.2.2.1.4 enable.

§Errors

DdsError::PreconditionNotMet if the parent entity is not enabled (per spec, children cannot be enabled before the parent — except the factory itself).

Source

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

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

Provided Methods§

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

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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Entity for DomainParticipant

Source§

impl Entity for Publisher

Available on crate feature std only.
Source§

impl Entity for Subscriber

Available on crate feature std only.
Source§

impl<T: DdsType> Entity for DataReader<T>

Available on crate feature std only.
Source§

impl<T: DdsType> Entity for DataWriter<T>

Available on crate feature std only.
Source§

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

Available on crate feature std only.