smithay::backend::udev

Struct UdevBackend

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

Backend to monitor available drm devices.

Provides a way to automatically scan for available gpus and notifies the given handler of any changes. Can be used to provide hot-plug functionality for gpus and attached monitors.

Implementations§

Source§

impl UdevBackend

Source

pub fn new<L, S: AsRef<str>>(seat: S, logger: L) -> IoResult<UdevBackend>
where L: Into<Option<Logger>>,

Creates a new UdevBackend

§Arguments

seat - system seat which should be bound logger - slog Logger to be used by the backend and its DrmDevices.

Source

pub fn device_list(&self) -> impl Iterator<Item = (dev_t, &Path)>

Get a list of DRM devices currently known to the backend

You should call this once before inserting the event source into your event loop, to get an initial snapshot of the device state.

Trait Implementations§

Source§

impl AsRawFd for UdevBackend

Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl Debug for UdevBackend

Source§

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

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

impl EventSource for UdevBackend

Source§

type Event = UdevEvent

The type of events generated by your source.
Source§

type Metadata = ()

Some metadata of your event source Read more
Source§

type Ret = ()

The return type of the user callback Read more
Source§

fn process_events<F>( &mut self, _: Readiness, token: Token, callback: F, ) -> Result<PostAction>
where F: FnMut(UdevEvent, &mut ()),

Process any relevant events Read more
Source§

fn register( &mut self, poll: &mut Poll, factory: &mut TokenFactory, ) -> Result<()>

Register yourself to this poll instance Read more
Source§

fn reregister( &mut self, poll: &mut Poll, factory: &mut TokenFactory, ) -> Result<()>

Re-register your file descriptors Read more
Source§

fn unregister(&mut self, poll: &mut Poll) -> Result<()>

Unregister your file descriptors Read more

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<A> DevPath for A
where A: AsRawFd,

Source§

fn dev_path(&self) -> Option<PathBuf>

Returns the path of the open device if possible
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V