pub struct Device<Ctx: DeviceContext = Normal>(/* private fields */);Expand description
The auxiliary device representation.
This structure represents the Rust abstraction for a C struct auxiliary_device. The
implementation abstracts the usage of an already existing C struct auxiliary_device within
Rust code that we get passed from the C side.
§Invariants
A Device instance represents a valid struct auxiliary_device created by the C portion of
the kernel.
Implementations§
Source§impl<Ctx: DeviceContext> Device<Ctx>
impl<Ctx: DeviceContext> Device<Ctx>
Source§impl Device<Bound>
impl Device<Bound>
Sourcepub fn parent(&self) -> &Device<Bound>
pub fn parent(&self) -> &Device<Bound>
Returns a bound reference to the parent device::Device.
Sourcepub fn registration_data<F: ForLt + 'static>(&self) -> Result<Pin<&F::Of<'_>>>
pub fn registration_data<F: ForLt + 'static>(&self) -> Result<Pin<&F::Of<'_>>>
Returns a pinned reference to the registration data set by the registering (parent) driver.
F is the ForLt encoding of the data type. The returned
reference has its lifetime shortened from 'static to &self’s borrow lifetime via
ForLt::cast_ref.
Returns EINVAL if F does not match the type used by the parent driver when calling
Registration::new().
Returns ENOENT if no registration data has been set, e.g. when the device was
registered by a C driver.
Trait Implementations§
Source§impl AlwaysRefCounted for Device
impl AlwaysRefCounted for Device
Source§impl<Ctx: DeviceContext> AsBusDevice<Ctx> for Device<Ctx>
impl<Ctx: DeviceContext> AsBusDevice<Ctx> for Device<Ctx>
Source§impl<'a> Deref for Device<CoreInternal<'a>>
impl<'a> Deref for Device<CoreInternal<'a>>
Source§impl<'a> From<&Device<CoreInternal<'a>>> for ARef<Device>
impl<'a> From<&Device<CoreInternal<'a>>> for ARef<Device>
Source§fn from(dev: &Device<CoreInternal<'a>>) -> Self
fn from(dev: &Device<CoreInternal<'a>>) -> Self
impl Send for Device
impl Sync for Device
impl Sync for Device<Bound>
Auto Trait Implementations§
impl<Ctx = Normal> !Freeze for Device<Ctx>
impl<Ctx = Normal> !RefUnwindSafe for Device<Ctx>
impl<Ctx = Normal> !Send for Device<Ctx>
impl<Ctx = Normal> !Sync for Device<Ctx>
impl<Ctx = Normal> !Unpin for Device<Ctx>
impl<Ctx = Normal> !UnsafeUnpin for Device<Ctx>
impl<Ctx> UnwindSafe for Device<Ctx>where
Ctx: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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