forked from mirrors/gstreamer-rs
Add MiniObject::from_glib_ptr_borrow()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1374>
This commit is contained in:
parent
e35782a3a4
commit
b5c7c402b9
1 changed files with 7 additions and 0 deletions
|
@ -28,6 +28,13 @@ macro_rules! mini_object_wrapper (
|
||||||
}
|
}
|
||||||
|
|
||||||
impl $name {
|
impl $name {
|
||||||
|
#[inline]
|
||||||
|
pub unsafe fn from_glib_ptr_borrow<'a>(
|
||||||
|
ptr: *const *const $ffi_name,
|
||||||
|
) -> &'a Self {
|
||||||
|
&*(ptr as *const $name)
|
||||||
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe fn from_glib_none(ptr: *const $ffi_name) -> Self {
|
pub unsafe fn from_glib_none(ptr: *const $ffi_name) -> Self {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
|
|
Loading…
Reference in a new issue