Trait kernel::drm::gem::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§
Required Methods§
sourcefn as_raw(&self) -> *mut drm_gem_object
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.
sourceunsafe fn as_ref<'a>(self_ptr: *mut drm_gem_object) -> &'a Self
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 toSelf
.- 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
.
Object Safety§
This trait is not object safe.