pub struct Registration<'a, T: Operations> { /* private fields */ }Expand description
A registered fwctl device.
Owns the RegistrationData made available to driver callbacks.
The parent device lifetime ensures that fwctl_unregister runs before the parent driver
unbinds.
On drop the device is unregistered (all user contexts are closed and ops is set to NULL)
and the registration data is dropped.
Implementations§
Source§impl<'a, T: Operations> Registration<'a, T>
impl<'a, T: Operations> Registration<'a, T>
Sourcepub unsafe fn new(
parent: &'a Device<Bound>,
dev: &Device<T>,
reg_data: impl PinInit<T::RegistrationData<'a>, Error>,
) -> Result<Self>
pub unsafe fn new( parent: &'a Device<Bound>, dev: &Device<T>, reg_data: impl PinInit<T::RegistrationData<'a>, Error>, ) -> Result<Self>
Register a previously allocated fwctl device with the given registration data.
The reg_data is owned by the registration and accessible during callbacks.
§Safety
Callers must not mem::forget() the returned Registration or otherwise prevent its
Drop implementation from running, since fwctl_unregister must be called before the
parent device is unbound.
dev must be an unregistered Device that is not associated with any live
Registration, and no other thread may attempt to register the same device concurrently.
Trait Implementations§
Source§impl<T: Operations> Drop for Registration<'_, T>
impl<T: Operations> Drop for Registration<'_, T>
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for Registration<'a, T>
impl<'a, T> !UnwindSafe for Registration<'a, T>
impl<'a, T> Freeze for Registration<'a, T>
impl<'a, T> Send for Registration<'a, T>
impl<'a, T> Sync for Registration<'a, T>
impl<'a, T> Unpin for Registration<'a, T>
impl<'a, T> UnsafeUnpin for Registration<'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
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
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.