Lines Matching defs:Device
33 pub struct Device<Ctx: device::DeviceContext = device::Normal>(
38 impl<Ctx: device::DeviceContext> Device<Ctx> {
49 // SAFETY: `Device` is a transparent wrapper of `Opaque<bindings::faux_device>`.
54 impl<Ctx: device::DeviceContext> AsRef<device::Device<Ctx>> for Device<Ctx> {
56 fn as_ref(&self) -> &device::Device<Ctx> {
59 unsafe { device::Device::from_raw(&raw mut (*self.as_raw()).dev) }
63 // SAFETY: `faux::Device` is a transparent wrapper of `struct faux_device`.
64 // The offset is guaranteed to point to a valid device field inside `faux::Device`.
65 unsafe impl<Ctx: device::DeviceContext> device::AsBusDevice<Ctx> for Device<Ctx> {
85 pub fn new(name: &CStr, parent: Option<&device::Device>) -> Result<Self> {
111 impl AsRef<Device<device::Bound>> for Registration {
113 fn as_ref(&self) -> &Device<device::Bound> {
123 unsafe { Device::from_raw(self.as_raw()) }