Trait ToGlibPtr

Source
pub trait ToGlibPtr<'a, P: Copy> {
    type Storage;

    // Required method
    fn to_glib_none(&'a self) -> Stash<'a, P, Self>;

    // Provided methods
    fn to_glib_container(&'a self) -> Stash<'a, P, Self> { ... }
    fn to_glib_full(&self) -> P { ... }
}
Expand description

Translate to a pointer.

Required Associated Types§

Required Methods§

Source

fn to_glib_none(&'a self) -> Stash<'a, P, Self>

Transfer: none.

The pointer in the Stash is only valid for the lifetime of the Stash.

Provided Methods§

Source

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Transfer: container.

We transfer the container ownership to the foreign library retaining the elements ownership.

Source

fn to_glib_full(&self) -> P

Transfer: full.

We transfer the ownership to the foreign library.

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<'a> ToGlibPtr<'a, *const i8> for str

Source§

impl<'a> ToGlibPtr<'a, *const i8> for String

Source§

impl<'a> ToGlibPtr<'a, *const i8> for OsStr

Source§

impl<'a> ToGlibPtr<'a, *const i8> for OsString

Source§

impl<'a> ToGlibPtr<'a, *const i8> for Path

Source§

impl<'a> ToGlibPtr<'a, *const i8> for PathBuf

Source§

impl<'a> ToGlibPtr<'a, *mut i8> for str

Source§

impl<'a> ToGlibPtr<'a, *mut i8> for String

Source§

impl<'a> ToGlibPtr<'a, *mut i8> for OsStr

Source§

impl<'a> ToGlibPtr<'a, *mut i8> for OsString

Source§

impl<'a> ToGlibPtr<'a, *mut i8> for Path

Source§

impl<'a> ToGlibPtr<'a, *mut i8> for PathBuf

Source§

impl<'a> ToGlibPtr<'a, *mut GHashTable> for HashMap<String, String>

Source§

impl<'a, P: Ptr, T: ToGlibContainerFromSlice<'a, P>> ToGlibPtr<'a, P> for [T]

Source§

type Storage = <T as ToGlibContainerFromSlice<'a, P>>::Storage

Source§

fn to_glib_none(&'a self) -> Stash<'a, P, Self>

Source§

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Source§

fn to_glib_full(&self) -> P

Source§

impl<'a, P: Ptr, T: ToGlibPtr<'a, P>> ToGlibPtr<'a, P> for Option<T>

Source§

type Storage = Option<<T as ToGlibPtr<'a, P>>::Storage>

Source§

fn to_glib_none(&'a self) -> Stash<'a, P, Option<T>>

Source§

fn to_glib_full(&self) -> P

Source§

impl<'a, P: Ptr, T: ?Sized + ToGlibPtr<'a, P>> ToGlibPtr<'a, P> for &'a T

Source§

type Storage = <T as ToGlibPtr<'a, P>>::Storage

Source§

fn to_glib_none(&'a self) -> Stash<'a, P, Self>

Source§

fn to_glib_full(&self) -> P

Implementors§

Source§

impl<'a, T: 'static, MM> ToGlibPtr<'a, *mut T> for Shared<T, MM>
where MM: SharedMemoryManager<T> + 'static,

Source§

type Storage = &'a Shared<T, MM>

Source§

impl<'a, T: 'static, MM: BoxedMemoryManager<T>> ToGlibPtr<'a, *const T> for Boxed<T, MM>

Source§

type Storage = &'a Boxed<T, MM>