Skip to content

Draft: vlcrs-core: add support for tracer API

The second commit exposes the TracerCapability trait as well as the TracerModuleLoader type to express the "tracer" capability for module implementations.

It preserves the current semantic from tracer implementation, which expects tracers to have inner thread safety, ie. be Sync in Rust. It also supports the Drop trait and forwards the destroy() from the core to the Rust module.

The second commit also exposes the Tracer type to provide a way to use the tracer as a client in Rust code, and uses it from tests. It also exposes alias types as Trace and TraceField, as well as implementing iteration through the different fields of a trace in a safe way.

The integrations test is using Tracer::create which requires the link to libvlccore, and it doesn't exist yet at the test level so it's not possible to actually run it for now.

The third commit implements a Telegraf[^1] tracer as example and will probably be moved towards a separate MR afterwards.

The MR is far from ready to merge, since a lot are missing. See the comments on the third commits for example. In particular, some level of unsafe is currently needed for the module implementation to use the trace data, and it would benefit from !5896 (merged) to use the complete interoperable types with safety constraints. Also, I need to finish the interoperability of tests with the libvlccore instance from the build folder. I was not happy with my previous attempt and tried a few weeks ago with newer alternatives.

I'd still want to open discussion and get feedback on the current status though.

Merge request reports