Trait glib::translate::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.

Implementations on Foreign Types§

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

type Storage = PhantomData<&'a CString>

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

type Storage = Cow<'static, [u8]>

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

fn to_glib_full(&self) -> *const c_char

source§

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

§

type Storage = PhantomData<&'a CString>

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

fn to_glib_full(&self) -> *const c_char

source§

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

§

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

§

type Storage = Cow<'static, [u8]>

source§

fn to_glib_none(&self) -> Stash<'a, *const c_char, String>

source§

fn to_glib_full(&self) -> *const c_char

source§

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

§

type Storage = HashTable

source§

fn to_glib_none(&self) -> Stash<'a, *mut GHashTable, Self>

source§

fn to_glib_full(&self) -> *mut GHashTable

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

type Storage = PhantomData<&'a CStr>

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

type Storage = Cow<'static, [u8]>

source§

fn to_glib_none(&self) -> Stash<'a, *mut c_char, String>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

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> ToGlibPtr<'a, P> for Cow<'a, T>where T: ToOwned + ?Sized + ToGlibPtr<'a, P>, T::Owned: ToGlibPtr<'a, P>,

§

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

source§

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

source§

fn to_glib_full(&self) -> P

source§

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

§

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

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

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

§

type Storage = CString

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

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

§

type Storage = PhantomData<&'a CStr>

source§

fn to_glib_none(&'a self) -> Stash<'a, *const c_char, Self>

source§

fn to_glib_full(&self) -> *const c_char

source§

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

§

type Storage = Cow<'static, [u8]>

source§

fn to_glib_none(&'a self) -> Stash<'a, *mut c_char, Self>

source§

fn to_glib_full(&self) -> *mut c_char

Implementors§

source§

impl<'a> ToGlibPtr<'a, *const *mut i8> for StrV

source§

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

source§

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

§

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

source§

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

§

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

source§

impl<'a, T: TransparentPtrType + 'a> ToGlibPtr<'a, *const <T as GlibPtrDefault>::GlibType> for PtrSlice<T>

source§

impl<'a, T: TransparentPtrType + 'a> ToGlibPtr<'a, *const GList> for List<T>

§

type Storage = PhantomData<&'a List<T>>

source§

impl<'a, T: TransparentPtrType + 'a> ToGlibPtr<'a, *const GSList> for SList<T>

§

type Storage = PhantomData<&'a SList<T>>

source§

impl<'a, T: TransparentPtrType + 'a> ToGlibPtr<'a, *mut <T as GlibPtrDefault>::GlibType> for PtrSlice<T>

source§

impl<'a, T: TransparentPtrType + 'a> ToGlibPtr<'a, *mut GList> for List<T>

§

type Storage = PhantomData<&'a List<T>>

source§

impl<'a, T: TransparentPtrType + 'a> ToGlibPtr<'a, *mut GSList> for SList<T>

§

type Storage = PhantomData<&'a SList<T>>

source§

impl<'a, T: TransparentType + 'a> ToGlibPtr<'a, *const <T as TransparentType>::GlibType> for Slice<T>

§

type Storage = PhantomData<&'a Slice<T>>

source§

impl<'a, T: TransparentType + 'a> ToGlibPtr<'a, *mut <T as TransparentType>::GlibType> for Slice<T>

§

type Storage = PhantomData<&'a Slice<T>>