pub trait Engine {
type Buffer: CommandBuffer + Clear;
// Required methods
fn get_command_buffer(&self) -> Self::Buffer;
fn render(&mut self, render_commands: &Self::Buffer) -> Result<()>;
fn finish_rendering(&mut self) -> Result<()>;
fn read_key(&self) -> Result<Key>;
}
Expand description
Represents the backend to draw prompts on the screen and handle input
Required Associated Types§
Sourcetype Buffer: CommandBuffer + Clear
type Buffer: CommandBuffer + Clear
Type of the corresponding command buffer
Required Methods§
Sourcefn get_command_buffer(&self) -> Self::Buffer
fn get_command_buffer(&self) -> Self::Buffer
Creates a new instanse of the CommandBuffer
implementation
Sourcefn render(&mut self, render_commands: &Self::Buffer) -> Result<()>
fn render(&mut self, render_commands: &Self::Buffer) -> Result<()>
Renders content to the terminal using the specified rendering commands
Sourcefn finish_rendering(&mut self) -> Result<()>
fn finish_rendering(&mut self) -> Result<()>
This is called when a prompt is submitted and needs to be rendered in its final state.