Struct DeviceHandle

Source
pub struct DeviceHandle {
    device: Arc<RwLock<Box<dyn Device>>>,
    state: RwLock<DeviceState>,
    borrow_count: RwLock<usize>,
}

Fields§

§device: Arc<RwLock<Box<dyn Device>>>§state: RwLock<DeviceState>§borrow_count: RwLock<usize>

Implementations§

Source§

impl DeviceHandle

Source

pub fn new(device: Arc<RwLock<Box<dyn Device>>>) -> Self

Source

pub fn is_in_use(&self) -> bool

Source

pub fn is_in_use_exclusive(&self) -> bool

Source

fn set_in_use(&self)

Source

fn set_available(&self)

Source

fn set_in_use_exclusive(&self)

Source

fn increment_borrow_count(&self)

Source

fn decrement_borrow_count(&self)

Source

pub fn get_borrow_count(&self) -> usize

Auto Trait Implementations§

§

impl !Freeze for DeviceHandle

§

impl !RefUnwindSafe for DeviceHandle

§

impl Send for DeviceHandle

§

impl Sync for DeviceHandle

§

impl Unpin for DeviceHandle

§

impl !UnwindSafe for DeviceHandle

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.