pub trait Backend {
// Required methods
fn open_device(
&mut self,
path: &Path,
) -> Result<(DeviceId, RawFd), SessionError>;
fn close_device(&mut self, id: DeviceId) -> Result<(), SessionError>;
fn acknowledge_pause(&mut self) -> Result<(), SessionError>;
fn switch_session(&mut self, session: i32) -> Result<(), SessionError>;
fn poll_fd(&self) -> Option<RawFd>;
fn dispatch(
&mut self,
timeout_ms: i32,
events: &mut Vec<RawEvent>,
) -> Result<(), SessionError>;
}Expand description
What a seat has to be able to do.
Deliberately small. Everything about when to call these – and what state
the session is in between them – is Session’s, so it can be tested
against a fake on a machine with no seat.
Required Methods§
Sourcefn open_device(
&mut self,
path: &Path,
) -> Result<(DeviceId, RawFd), SessionError>
fn open_device( &mut self, path: &Path, ) -> Result<(DeviceId, RawFd), SessionError>
Sourcefn close_device(&mut self, id: DeviceId) -> Result<(), SessionError>
fn close_device(&mut self, id: DeviceId) -> Result<(), SessionError>
Sourcefn acknowledge_pause(&mut self) -> Result<(), SessionError>
fn acknowledge_pause(&mut self) -> Result<(), SessionError>
Tell the seat the pause has been acted on.
Until this returns, the seat is waiting: the switch does not complete and the user is looking at a display that has not changed.
§Errors
Sourcefn switch_session(&mut self, session: i32) -> Result<(), SessionError>
fn switch_session(&mut self, session: i32) -> Result<(), SessionError>
Sourcefn poll_fd(&self) -> Option<RawFd>
fn poll_fd(&self) -> Option<RawFd>
A descriptor that becomes readable when the seat has something to say.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Backend for LibseatBackend
Available on crate feature
libseat only.