pub struct File<D: Driver>(/* private fields */);Expand description
An open DRM File.
§Invariants
self.0is a valid instance of astruct drm_fileopened on a device of driverD.- A
drm::RegistrationGuardfor that device is held for the duration of any&File<D>reference.
Implementations§
Source§impl<D: Driver> File<D>
impl<D: Driver> File<D>
Sourcepub fn device(&self) -> &Device<D, Registered>
pub fn device(&self) -> &Device<D, Registered>
Returns the registered DRM device this file was opened on.
Sourcepub fn inner_with<'this, R, F>(&'this self, f: F) -> R
pub fn inner_with<'this, R, F>(&'this self, f: F) -> R
Access the driver file data through a closure.
The closure receives a pinned reference to the file data.
The outer reference carries the &self lifetime while the inner type carries the HRTB
lifetime 'a, implying 'a outlives &self. This allows the closure to coerce covariant
sub-fields (e.g. &'a T to the caller’s lifetime) and return them directly in R.
Auto Trait Implementations§
impl<D> !Freeze for File<D>
impl<D> !RefUnwindSafe for File<D>
impl<D> !Send for File<D>
impl<D> !Sync for File<D>
impl<D> !Unpin for File<D>
impl<D> !UnsafeUnpin for File<D>
impl<D> Forget for File<D>
impl<D> Move for File<D>
impl<D> UnwindSafe for File<D>where
PhantomData<D>: UnwindSafe,
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<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
Convert
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
Convert
self into a T. This operation is guaranteed to be lossless.