pub struct RegistrationGuard<'a, T: Driver> { /* private fields */ }Expand description
A guard proving the DRM device is registered and the parent bus device is bound.
The guard dereferences to Device<T, Registered>, providing access to the DRM device with
the guarantee that the parent bus device is bound for the entire duration of the critical
section.
Internally this is backed by a drm_dev_enter() / drm_dev_exit() SRCU critical section.
§Invariants
idxis the SRCU read lock index returned by a successfuldrm_dev_enter()call.- The parent bus device of
devis bound for the lifetime of this guard.
Methods from Deref<Target = Device<T, Registered>>§
Sourcepub fn registration_data_with<R, F>(&self, f: F) -> Rwhere
F: for<'a> FnOnce(&'a T::RegistrationData<'a>) -> R,
pub fn registration_data_with<R, F>(&self, f: F) -> Rwhere
F: for<'a> FnOnce(&'a T::RegistrationData<'a>) -> R,
Access the registration data through a closure, with the lifetime tied to the closure scope.
The data is owned by Registration and is guaranteed to remain valid
as long as the device is registered, since Registration’s drop
calls drm_dev_unplug() which waits for all drm_dev_enter() critical sections to
complete.
Trait Implementations§
Source§impl<T: Driver> Deref for RegistrationGuard<'_, T>
impl<T: Driver> Deref for RegistrationGuard<'_, T>
Source§impl<T: Driver> Drop for RegistrationGuard<'_, T>
impl<T: Driver> Drop for RegistrationGuard<'_, T>
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for RegistrationGuard<'a, T>
impl<'a, T> !Send for RegistrationGuard<'a, T>
impl<'a, T> !Sync for RegistrationGuard<'a, T>
impl<'a, T> !UnwindSafe for RegistrationGuard<'a, T>
impl<'a, T> Freeze for RegistrationGuard<'a, T>
impl<'a, T> Unpin for RegistrationGuard<'a, T>
impl<'a, T> UnsafeUnpin for RegistrationGuard<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> KnownSize for T
impl<T> KnownSize for T
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
Initializes
slot. Read more