pub trait LibinputInterface {
// Required methods
fn open_restricted(
&mut self,
path: &Path,
flags: i32,
) -> Result<OwnedFd, i32>;
fn close_restricted(&mut self, fd: OwnedFd);
}Available on crate feature
libinput only.Expand description
libinput does not open file descriptors to devices directly,
instead open_restricted and close_restricted are called for
each path that must be opened.
Implementations are of course permitted to just use open and
close respectively, but doing so would require root permissions
to open devices. This interface provides an api agnostic way to
use ConsoleKit or similar endpoints to open devices without
direct priviledge escalation.
Required Methods§
Sourcefn close_restricted(&mut self, fd: OwnedFd)
fn close_restricted(&mut self, fd: OwnedFd)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".