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_guard(&self) -> Option<RegistrationGuard<'_, T>>
pub fn registration_guard(&self) -> Option<RegistrationGuard<'_, T>>
Guard against the parent bus device being unbound.
Returns a RegistrationGuard if the device has not been unplugged, None otherwise.
While RegistrationGuard is held the parent device is guaranteed to be bound.
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>
Auto Trait Implementations§
impl<'a, T> Freeze for RegistrationGuard<'a, T>
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> Unpin for RegistrationGuard<'a, T>
impl<'a, T> !UnwindSafe 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
Source§impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
impl<S, T> IntoSafeCast<T> for Swhere
T: FromSafeCast<S>,
Source§fn into_safe_cast(self) -> T
fn into_safe_cast(self) -> T
self into a T. This operation is guaranteed to be lossless.Source§impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
impl<S, T> IntoSafeCastArch<T> for Swhere
T: FromSafeCastArch<S>,
Source§fn into_safe_cast_arch(self) -> T
fn into_safe_cast_arch(self) -> T
self into a T. This operation is guaranteed to be lossless.