Skip to content

Instantiate {Event,Message,Query}s from the target type

See initial discussion in #265 (closed)

For Events and Messages, we actually instantiate an Event and Message. With the implementation leading to the following usage, clippy warns that new should return Self:

let stream_start_evt = gst::event::StreamStart::new(&stream_id);

In this MR I used new_event and new_message for that reason, but I'd rather stick to the original proposal. The way these types are designed is such that we can't get a plain StreamStart anyway, these types are always manipulated as Events or as EventViews via view.

Here are the options I can think of:

  • Instantiate with new_event & new_message as is.
  • Instantiate with new_evt & new_msg, same but lighter.
  • Instantiate with new and silence clippy.

Fixes #265 (closed)

Edited by François Laignel

Merge request reports

Loading