pub trait FromGlibPtrBorrow<P>: Sizedwhere
    P: Ptr,{
    // Provided method
    unsafe fn from_glib_borrow(_ptr: P) -> Borrowed<Self> { ... }
}
Expand description

Translate from a pointer type by borrowing, without affecting the refcount.

The purpose of this trait is to access values inside callbacks without changing their reference status. The obtained borrow must not be accessed outside of the scope of the callback, and called procedures must not store any references to the underlying data. Safe Rust code must never obtain a mutable Rust reference.

Safety

The implementation of this trait as well as the returned type must satisfy the same constraints together. They must not take ownership of the underlying value, copy it, and should not change its reference count. If it does, it must properly release obtained references.

The returned value, when dropped, must leave the underlying value in the same state as before from_glib_borrow was called:

  • it must not be dropped,
  • it must be the same type of reference, e.g. still floating.

For more information, refer to module level documentation.

Provided Methods§

unsafe fn from_glib_borrow(_ptr: P) -> Borrowed<Self>

Safety

See trait level notes on safety

Implementations on Foreign Types§

§

impl FromGlibPtrBorrow<*mut GdkEventCrossing> for EventCrossing

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventCrossing ) -> Borrowed<EventCrossing>

§

impl FromGlibPtrBorrow<*mut GdkEventConfigure> for EventConfigure

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventConfigure ) -> Borrowed<EventConfigure>

§

impl FromGlibPtrBorrow<*mut GdkEventTouch> for EventTouch

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventTouch) -> Borrowed<EventTouch>

§

impl FromGlibPtrBorrow<*mut GdkEventProperty> for EventProperty

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventProperty ) -> Borrowed<EventProperty>

§

impl FromGlibPtrBorrow<*mut GdkEventExpose> for EventExpose

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventExpose) -> Borrowed<EventExpose>

§

impl FromGlibPtrBorrow<*mut GdkEventDND> for EventDND

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventDND) -> Borrowed<EventDND>

§

impl FromGlibPtrBorrow<*mut GdkEventPadGroupMode> for EventPadGroupMode

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventPadGroupMode ) -> Borrowed<EventPadGroupMode>

§

impl FromGlibPtrBorrow<*mut GdkEventFocus> for EventFocus

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventFocus) -> Borrowed<EventFocus>

§

impl FromGlibPtrBorrow<*mut GdkEventMotion> for EventMotion

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventMotion) -> Borrowed<EventMotion>

§

impl FromGlibPtrBorrow<*mut GdkEventTouchpadSwipe> for EventTouchpadSwipe

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventTouchpadSwipe ) -> Borrowed<EventTouchpadSwipe>

§

impl FromGlibPtrBorrow<*mut GdkEventScroll> for EventScroll

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventScroll) -> Borrowed<EventScroll>

§

impl FromGlibPtrBorrow<*mut GdkEventPadButton> for EventPadButton

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventPadButton ) -> Borrowed<EventPadButton>

§

impl FromGlibPtrBorrow<*mut GdkEventWindowState> for EventWindowState

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventWindowState ) -> Borrowed<EventWindowState>

§

impl FromGlibPtrBorrow<*mut GdkEventAny> for Event

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventAny) -> Borrowed<Event>

§

impl FromGlibPtrBorrow<*mut GdkEventGrabBroken> for EventGrabBroken

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventGrabBroken ) -> Borrowed<EventGrabBroken>

§

impl FromGlibPtrBorrow<*mut GdkEventOwnerChange> for EventOwnerChange

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventOwnerChange ) -> Borrowed<EventOwnerChange>

§

impl FromGlibPtrBorrow<*mut GdkEventProximity> for EventProximity

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventProximity ) -> Borrowed<EventProximity>

§

impl FromGlibPtrBorrow<*mut GdkEventKey> for EventKey

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventKey) -> Borrowed<EventKey>

§

impl FromGlibPtrBorrow<*mut GdkEventVisibility> for EventVisibility

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventVisibility ) -> Borrowed<EventVisibility>

§

impl FromGlibPtrBorrow<*mut GdkEventSelection> for EventSelection

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventSelection ) -> Borrowed<EventSelection>

§

impl FromGlibPtrBorrow<*mut GdkEventTouchpadPinch> for EventTouchpadPinch

§

unsafe fn from_glib_borrow( ptr: *mut GdkEventTouchpadPinch ) -> Borrowed<EventTouchpadPinch>

§

impl FromGlibPtrBorrow<*mut GdkEventSetting> for EventSetting

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventSetting) -> Borrowed<EventSetting>

§

impl FromGlibPtrBorrow<*mut GdkEventButton> for EventButton

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventButton) -> Borrowed<EventButton>

§

impl FromGlibPtrBorrow<*mut _GdkAtom> for Atom

§

unsafe fn from_glib_borrow(ptr: *mut _GdkAtom) -> Borrowed<Atom>

§

impl FromGlibPtrBorrow<*mut GdkEventPadAxis> for EventPadAxis

§

unsafe fn from_glib_borrow(ptr: *mut GdkEventPadAxis) -> Borrowed<EventPadAxis>

Implementors§