Trait zellij_server::os_input_output::ServerOsApi[][src]

pub trait ServerOsApi: Send + Sync {
Show 14 methods fn set_terminal_size_using_fd(&self, fd: RawFd, cols: u16, rows: u16);
fn spawn_terminal(
        &self,
        terminal_action: TerminalAction
    ) -> (RawFd, ChildId);
fn read_from_tty_stdout(
        &self,
        fd: RawFd,
        buf: &mut [u8]
    ) -> Result<usize, Error>;
fn async_file_reader(&self, fd: RawFd) -> Box<dyn AsyncReader>;
fn write_to_tty_stdin(&self, fd: RawFd, buf: &[u8]) -> Result<usize, Error>;
fn tcdrain(&self, fd: RawFd) -> Result<(), Error>;
fn kill(&self, pid: Pid) -> Result<(), Error>;
fn force_kill(&self, pid: Pid) -> Result<(), Error>;
fn box_clone(&self) -> Box<dyn ServerOsApi>;
fn send_to_client(&self, client_id: u16, msg: ServerToClientMsg);
fn new_client(
        &mut self,
        client_id: u16,
        stream: LocalSocketStream
    ) -> IpcReceiverWithContext<ClientToServerMsg>;
fn remove_client(&mut self, client_id: u16);
fn load_palette(&self) -> Palette;
fn get_cwd(&self, pid: Pid) -> Option<PathBuf>;
}
Expand description

The ServerOsApi trait represents an abstract interface to the features of an operating system that Zellij server requires.

Required methods

Sets the size of the terminal associated to file descriptor fd.

Spawn a new terminal, with a terminal action. The returned tuple contains the master file descriptor of the forked psuedo terminal and a ChildId struct containing process id’s for the forked child process.

Read bytes from the standard output of the virtual terminal referred to by fd.

Creates an AsyncReader that can be used to read from fd in an async context

Write bytes to the standard input of the virtual terminal referred to by fd.

Wait until all output written to the object referred to by fd has been transmitted.

Terminate the process with process ID pid. (SIGTERM)

Terminate the process with process ID pid. (SIGKILL)

Returns a Box pointer to this ServerOsApi struct.

Returns the current working directory for a given pid

Implementors