Trait FromGlibPtrNone

pub trait FromGlibPtrNone<P>: Sized
where P: Ptr,
{ // Required method unsafe fn from_glib_none(ptr: P) -> Self; }
Expand description

Translate from a pointer type which is annotated with transfer none. The resulting value is referenced at least once, by the bindings.

This is suitable for floating references, which become strong references. It is also suitable for acquiring non-gobject values, like gchar*.

§Safety

The implementation of this trait should acquire a reference to the value in a way appropriate to the type, e.g. by increasing the reference count or copying. 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§

unsafe fn from_glib_none(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§

§

impl FromGlibPtrNone<*const i8> for String

§

unsafe fn from_glib_none(ptr: *const i8) -> String

§

impl FromGlibPtrNone<*const i8> for OsString

§

impl FromGlibPtrNone<*const i8> for PathBuf

§

impl FromGlibPtrNone<*mut i8> for String

§

unsafe fn from_glib_none(ptr: *mut i8) -> String

§

impl FromGlibPtrNone<*mut i8> for OsString

§

unsafe fn from_glib_none(ptr: *mut i8) -> OsString

§

impl FromGlibPtrNone<*mut i8> for PathBuf

§

unsafe fn from_glib_none(ptr: *mut i8) -> PathBuf

§

impl FromGlibPtrNone<*mut _GIOExtension> for IOExtension

§

unsafe fn from_glib_none(ptr: *mut _GIOExtension) -> IOExtension

§

impl FromGlibPtrNone<*mut _GIOExtensionPoint> for IOExtensionPoint

§

unsafe fn from_glib_none(ptr: *mut _GIOExtensionPoint) -> IOExtensionPoint

§

impl FromGlibPtrNone<*mut cairo_device_t> for Device

§

unsafe fn from_glib_none(ptr: *mut cairo_device_t) -> Device

§

impl FromGlibPtrNone<*mut cairo_surface_t> for ImageSurface

§

unsafe fn from_glib_none(ptr: *mut cairo_surface_t) -> ImageSurface

§

impl FromGlibPtrNone<*mut cairo_surface_t> for RecordingSurface

§

unsafe fn from_glib_none(ptr: *mut cairo_surface_t) -> RecordingSurface

§

impl FromGlibPtrNone<*mut cairo_surface_t> for Surface

§

unsafe fn from_glib_none(ptr: *mut cairo_surface_t) -> Surface

§

impl FromGlibPtrNone<*mut cairo_t> for Context

§

unsafe fn from_glib_none(ptr: *mut cairo_t) -> Context

§

impl<P, T> FromGlibPtrNone<P> for Option<T>
where P: Ptr, T: FromGlibPtrNone<P>,

§

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

Implementors§

§

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

§

impl<T, MM> FromGlibPtrNone<*const T> for Shared<T, MM>
where T: 'static, MM: SharedMemoryManager<Target = T>,

§

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

§

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