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§
Required Methods§
Sourcefn set_qos(&self, qos: Self::Qos) -> Result<()>
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
DdsError::ImmutablePolicyif an immutable field is to be changed afterenable().DdsError::InconsistentPolicyif the new QoS combination is inconsistent.
Sourcefn enable(&self) -> Result<()>
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).
Sourcefn entity_state(&self) -> Arc<EntityState> ⓘ
fn entity_state(&self) -> Arc<EntityState> ⓘ
Internal accessor — each impl returns its Arc<EntityState>.
Provided Methods§
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
True if the entity is already enabled.
Sourcefn get_status_condition(&self) -> StatusCondition
fn get_status_condition(&self) -> StatusCondition
StatusCondition of this entity.
Spec §2.2.2.1.6 get_status_condition.
Sourcefn get_status_changes(&self) -> StatusMask
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.
Sourcefn get_instance_handle(&self) -> InstanceHandle
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
impl Entity for DomainParticipant
type Qos = DomainParticipantQos
Source§impl Entity for Subscriber
Available on crate feature std only.
impl Entity for Subscriber
std only.type Qos = SubscriberQos
Source§impl<T: DdsType> Entity for DataReader<T>
Available on crate feature std only.
impl<T: DdsType> Entity for DataReader<T>
std only.type Qos = DataReaderQos
Source§impl<T: DdsType> Entity for DataWriter<T>
Available on crate feature std only.
impl<T: DdsType> Entity for DataWriter<T>
std only.