glib::translate

Trait FromGlibPtrFull

Source
pub trait FromGlibPtrFull<P: Ptr>: Sized {
    // Required method
    unsafe fn from_glib_full(ptr: P) -> Self;
}
Expand description

Translate from a pointer type which is annotated with transfer full. This transfers the ownership of the value to the Rust side.

Because ownership can only be transferred if something is already referenced, this is unsuitable for floating references.

§Safety

The implementation of this trait should not alter the reference count or make copies of the underlying value. Values obtained using this trait must be properly released on drop() by the implementing type.

For more information, refer to module level documentation.

Required Methods§

Source

unsafe fn from_glib_full(ptr: P) -> Self

§Safety

See trait level notes on safety

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromGlibPtrFull<*const i8> for String

Source§

unsafe fn from_glib_full(ptr: *const c_char) -> Self

Source§

impl FromGlibPtrFull<*const i8> for OsString

Source§

unsafe fn from_glib_full(ptr: *const c_char) -> Self

Source§

impl FromGlibPtrFull<*const i8> for PathBuf

Source§

unsafe fn from_glib_full(ptr: *const c_char) -> Self

Source§

impl FromGlibPtrFull<*mut i8> for String

Source§

unsafe fn from_glib_full(ptr: *mut c_char) -> Self

Source§

impl FromGlibPtrFull<*mut i8> for OsString

Source§

unsafe fn from_glib_full(ptr: *mut c_char) -> Self

Source§

impl FromGlibPtrFull<*mut i8> for PathBuf

Source§

unsafe fn from_glib_full(ptr: *mut c_char) -> Self

Source§

impl<P: Ptr, T: FromGlibPtrFull<P>> FromGlibPtrFull<P> for Option<T>

Source§

unsafe fn from_glib_full(ptr: P) -> Option<T>

Implementors§

Source§

impl<T: 'static, MM: BoxedMemoryManager<Target = T>> FromGlibPtrFull<*const T> for Boxed<T, MM>

Source§

impl<T: 'static, MM: BoxedMemoryManager<Target = T>> FromGlibPtrFull<*mut T> for Boxed<T, MM>

Source§

impl<T: 'static, MM: SharedMemoryManager<Target = T>> FromGlibPtrFull<*mut T> for Shared<T, MM>