pub struct Registration<T: 'static> { /* private fields */ }Expand description
The registration of an auxiliary device.
This type represents the registration of a [struct auxiliary_device]. When its parent device
is unbound, the corresponding auxiliary device will be unregistered from the system.
The type parameter T is the type of the registration data owned by the registering (parent)
driver. It can be accessed by the auxiliary driver through
Device::registration_data().
§Invariants
self.adev always holds a valid pointer to an initialized and registered
[struct auxiliary_device] whose registration_data_rust field points to a
valid Pin<KBox<RegistrationData<T>>>.
Implementations§
Source§impl<T: Send + Sync + 'static> Registration<T>
impl<T: Send + Sync + 'static> Registration<T>
Sourcepub fn new<E>(
parent: &Device<Bound>,
name: &CStr,
id: u32,
modname: &CStr,
data: impl PinInit<T, E>,
) -> Result<Devres<Self>>
pub fn new<E>( parent: &Device<Bound>, name: &CStr, id: u32, modname: &CStr, data: impl PinInit<T, E>, ) -> Result<Devres<Self>>
Create and register a new auxiliary device with the given registration data.
The data is owned by the registration and can be accessed through the auxiliary device
via Device::registration_data().
Trait Implementations§
Source§impl<T: 'static> Drop for Registration<T>
impl<T: 'static> Drop for Registration<T>
impl<T: Send + Sync> Send for Registration<T>
impl<T: Send + Sync> Sync for Registration<T>
Auto Trait Implementations§
impl<T> Freeze for Registration<T>
impl<T> RefUnwindSafe for Registration<T>where
T: RefUnwindSafe,
impl<T> Unpin for Registration<T>where
T: Unpin,
impl<T> UnsafeUnpin for Registration<T>
impl<T> UnwindSafe for Registration<T>where
T: 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
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>
slot. Read more