UdevQueue

Struct UdevQueue 

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

Represents the current event queue in the udev daemon.

Implementations§

Source§

impl UdevQueue

Source

pub fn new(udev: Arc<Udev>) -> Self

Creates a new UdevQueue.

Source

pub fn create<Q: Into<UdevEntryList>>( udev: Arc<Udev>, queue_list: Q, fd: i32, ) -> Self

Creates a new UdevQueue from the provided parameters.

Source

pub const fn udev(&self) -> &Arc<Udev>

Gets a reference to the Udev context.

Source

pub const fn queue_list(&self) -> &UdevList

Gets a reference to the queue list UdevList.

Source

pub fn queue_list_mut(&mut self) -> &mut UdevList

Gets a mutable reference to the queue list UdevList.

Source

pub fn set_queue_list<Q: Into<UdevEntryList>>(&mut self, queue_list: Q)

Sets the queue list UdevEntryList.

Source

pub fn with_queue_list<Q: Into<UdevEntryList>>(self, queue_list: Q) -> Self

Builder function that sets the queue list UdevEntryList.

Source

pub fn len(&self) -> usize

Gets the length of the UdevQueue.

Source

pub fn is_empty(&self) -> bool

Gets whether the UdevQueue is empty.

Source

pub const fn fd(&self) -> i32

Gets the UdevQueue file descriptor.

Source

pub fn set_fd(&mut self, val: i32)

Sets the UdevQueue file descriptor.

Source

pub fn with_fd(self, val: i32) -> Self

Builder function that sets the UdevQueue file descriptor.

Source

pub fn get_fd(&mut self) -> Result<i32>

Gets a file descriptor to watch for a queue to become empty.

Source

pub fn flush(&mut self) -> Result<()>

Clears the watched file descriptor for queue changes.

§Safety

Users must ensure that every UdevQueue has a unique file descriptor, if the descriptor is non-negative.

Returns: Ok(()) on success, Err(Error) otherwise.

Source

pub fn udev_is_active(&self) -> bool

Checks if Udev is active on the system.

Source

pub fn queue_is_empty(&self) -> bool

Gets whether UdevQueue is currently processing any events.

Trait Implementations§

Source§

impl Clone for UdevQueue

Source§

fn clone(&self) -> UdevQueue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UdevQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UdevQueue

Source§

fn default() -> UdevQueue

Returns the “default value” for a type. Read more
Source§

impl PartialEq for UdevQueue

Source§

fn eq(&self, other: &UdevQueue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for UdevQueue

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.