Trait IntoGEMObject

Source
pub trait IntoGEMObject:
    Sized
    + Sealed
    + AlwaysRefCounted {
    type Driver: Driver;

    // Required methods
    fn as_raw(&self) -> *mut drm_gem_object;
    unsafe fn as_ref<'a>(self_ptr: *mut drm_gem_object) -> &'a Self;
}
Expand description

Trait that represents a GEM object subtype

Required Associated Types§

Source

type Driver: Driver

Owning driver for this type

Required Methods§

Source

fn as_raw(&self) -> *mut drm_gem_object

Returns a reference to the raw drm_gem_object structure, which must be valid as long as this owning object is valid.

Source

unsafe fn as_ref<'a>(self_ptr: *mut drm_gem_object) -> &'a Self

Converts a pointer to a struct drm_gem_object into a reference to Self.

§Safety
  • self_ptr must be a valid pointer to Self.
  • The caller promises that holding the immutable reference returned by this function does not violate rust’s data aliasing rules and remains valid throughout the lifetime of 'a.

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.

Implementors§