Proposal: instantiate {Event,Message,Query}s from the target type
Instantiating an {Event
,Message
,Query
}, implies calling the C-alike new_...
functions on the generic type.
Ex.:
let stream_start_evt = gst::Event::new_stream_start(&stream_id).build();
For Event
s and Message
s, we actually get a builder which allows adding optional data.
In Rust, we could expect the following instead:
- For mandatory fields only:
let stream_start_evt = gst::event::StreamStart::new(&stream_id);
- For mandatory and optional fields:
let stream_start_evt = gst::event::StreamStartBuilder::new(&stream_id)
.group_id(gst::GroupId::next())
.build();
Edited by François Laignel