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
impl UdevBackend
Sourcepub fn new<L, S: AsRef<str>>(seat: S, logger: L) -> IoResult<UdevBackend>
pub fn new<L, S: AsRef<str>>(seat: S, logger: L) -> IoResult<UdevBackend>
Creates a new UdevBackend
§Arguments
seat
- system seat which should be bound
logger
- slog Logger to be used by the backend and its DrmDevices
.
Sourcepub fn device_list(&self) -> impl Iterator<Item = (dev_t, &Path)>
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
impl AsRawFd for UdevBackend
Source§impl Debug for UdevBackend
impl Debug for UdevBackend
Source§impl EventSource for UdevBackend
impl EventSource for UdevBackend
Source§fn process_events<F>(
&mut self,
_: Readiness,
token: Token,
callback: F,
) -> Result<PostAction>
fn process_events<F>( &mut self, _: Readiness, token: Token, callback: F, ) -> Result<PostAction>
Process any relevant events Read more
Source§fn register(
&mut self,
poll: &mut Poll,
factory: &mut TokenFactory,
) -> Result<()>
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<()>
fn reregister( &mut self, poll: &mut Poll, factory: &mut TokenFactory, ) -> Result<()>
Re-register your file descriptors Read more
Auto Trait Implementations§
impl Freeze for UdevBackend
impl RefUnwindSafe for UdevBackend
impl !Send for UdevBackend
impl !Sync for UdevBackend
impl Unpin for UdevBackend
impl UnwindSafe for UdevBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
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>
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)
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)
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.