gst::DateTime construction in Rust

Sebastian Dröge sebastian at centricular.com
Mon May 20 10:42:05 UTC 2019


On Mon, 2019-05-20 at 08:45 +0100, Russel Winder wrote:
> 
> > Depending on the ownership semantics, you want from_glib_none() for
> > transfer none or from_glib_full() for transfer full here.
> 
> I am guessing that one has to read the C API documents to determine whether to
> use "none" or "full" for the functions of the API in Rust. However the current
> problem is dealing with data structures directly so I am guessing use "none".

It depends on whether you can borrow the struct field directly or need
to return a new reference. That's something for which you need to
understand how the C API in question works.

One of the things where Rust moves things that are hopefully mentioned
in the documentation to the language.

> In C/C++ it was a question of using the gst_date_time_ref function, I am
> assuming this is effectively what happens when using from_glib_none?

Yes, that's correct.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190520/6a9651b9/attachment.sig>


More information about the gstreamer-devel mailing list