-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
Medium difficultyMedium issue which can be prioritized by a sponsorMedium issue which can be prioritized by a sponsorsponsor wantedSeeking a sponsor to prioritize and implement this issue.Seeking a sponsor to prioritize and implement this issue.
Description
Currently, as far as I know, xtype union (enum) are not supported.
DdsType does not raise any compile-time error, but when an enum (xtype union) is used, for example, during a write operation, the program crashes with "not yet implemented” error".
The following straightforward example compiles successfully but crashes when .write(...) is called.
use dust_dds::{
domain::domain_participant_factory::DomainParticipantFactory,
infrastructure::{
qos::QosKind,
status::NO_STATUS,
type_support::{DdsType, TypeSupport},
},
listener::NO_LISTENER,
};
#[derive(DdsType)]
enum TestUnion {
U8(u8),
U16(u16),
}
fn main() {
let domain_participant = DomainParticipantFactory::get_instance()
.create_participant(1, QosKind::Default, NO_LISTENER, NO_STATUS)
.unwrap();
let topic = domain_participant
.create_topic::<TestUnion>(
"test",
TestUnion::get_type_name(),
QosKind::Default,
NO_LISTENER,
NO_STATUS,
)
.unwrap();
let publisher = domain_participant
.create_publisher(QosKind::Default, NO_LISTENER, NO_STATUS)
.unwrap();
let writer = publisher
.create_datawriter::<TestUnion>(&topic, QosKind::Default, NO_LISTENER, NO_STATUS)
.unwrap();
// PANICS: "not yet implemented"
writer.write(TestUnion::U8(128), None).unwrap();
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Medium difficultyMedium issue which can be prioritized by a sponsorMedium issue which can be prioritized by a sponsorsponsor wantedSeeking a sponsor to prioritize and implement this issue.Seeking a sponsor to prioritize and implement this issue.