pub trait Session {
type Error: AsErrno;
// Required methods
fn open(
&mut self,
path: &Path,
flags: OFlags,
) -> Result<OwnedFd, Self::Error>;
fn close(&mut self, fd: OwnedFd) -> Result<(), Self::Error>;
fn change_vt(&mut self, vt: i32) -> Result<(), Self::Error>;
fn is_active(&self) -> bool;
fn seat(&self) -> String;
}Available on crate feature
backend_session only.Expand description
General session interface.
Provides a way to open and close devices and change the active vt.
Required Associated Types§
Required Methods§
Sourcefn open(&mut self, path: &Path, flags: OFlags) -> Result<OwnedFd, Self::Error>
fn open(&mut self, path: &Path, flags: OFlags) -> Result<OwnedFd, Self::Error>
Opens a device at the given path with the given flags.
Returns a raw file descriptor
Sourcefn close(&mut self, fd: OwnedFd) -> Result<(), Self::Error>
fn close(&mut self, fd: OwnedFd) -> Result<(), Self::Error>
Close a previously opened file descriptor