Device

Struct Device 

Source
pub struct Device { /* private fields */ }
Expand description

safe device object wrapper

Implementations§

Source§

impl Device

Source

pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>

wrap raw device object pointer

§Safety

ptr must be a valid DEVICE_OBJECT pointer

Source

pub fn as_raw(&self) -> *mut DeviceObjectRaw

get raw pointer

Source

pub fn set_flags(&mut self, flags: u32)

set device flags

Source

pub fn add_flag(&mut self, flag: u32)

add device flag

Source

pub fn remove_flag(&mut self, flag: u32)

remove device flag

Source

pub fn flags(&self) -> u32

get device flags

Source

pub fn device_type(&self) -> u32

get device type

Source

pub fn extension<T>(&self) -> Option<&T>

get device extension

Source

pub fn extension_mut<T>(&mut self) -> Option<&mut T>

get mutable device extension

create symbolic link for this device

delete symbolic link

Source

pub fn set_buffered_io(&mut self)

set DO_BUFFERED_IO flag (for small data transfers)

Source

pub fn set_direct_io(&mut self)

set DO_DIRECT_IO flag (for large data transfers)

Source

pub fn initialization_complete(&mut self)

clear the DO_DEVICE_INITIALIZING flag (required after device creation)

Trait Implementations§

Source§

impl Drop for Device

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for Device

§

impl RefUnwindSafe for Device

§

impl !Send for Device

§

impl !Sync for Device

§

impl Unpin for Device

§

impl UnwindSafe for Device

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.