pub trait BufferManagementBehavior {
Show 16 methods
// Required methods
fn buffer_manager(&mut self) -> &mut BufferManager;
fn buffer_handler(&mut self) -> &mut BufferHandler;
fn buffer(&self) -> &dyn BufferAPI;
fn buffer_mut(&mut self) -> &mut dyn BufferAPI;
fn config(&self) -> &Config;
fn cursor_manager(&mut self) -> &mut CursorManager;
fn set_input_text_with_cursor(&mut self, text: String, cursor: usize);
fn next_buffer(&mut self) -> String;
fn previous_buffer(&mut self) -> String;
fn quick_switch_buffer(&mut self) -> String;
fn close_buffer(&mut self) -> (bool, String);
fn switch_to_buffer(&mut self, index: usize) -> String;
fn buffer_count(&self) -> usize;
fn current_buffer_index(&self) -> usize;
// Provided methods
fn new_buffer(&mut self) { ... }
fn yank(&mut self) { ... }
}
Expand description
Trait that provides buffer management behavior for TUI components This extracts buffer operations from EnhancedTui to reduce coupling
Required Methods§
fn buffer_manager(&mut self) -> &mut BufferManager
fn buffer_handler(&mut self) -> &mut BufferHandler
fn buffer(&self) -> &dyn BufferAPI
fn buffer_mut(&mut self) -> &mut dyn BufferAPI
fn config(&self) -> &Config
fn cursor_manager(&mut self) -> &mut CursorManager
fn set_input_text_with_cursor(&mut self, text: String, cursor: usize)
Sourcefn next_buffer(&mut self) -> String
fn next_buffer(&mut self) -> String
Switch to the next buffer
Sourcefn previous_buffer(&mut self) -> String
fn previous_buffer(&mut self) -> String
Switch to the previous buffer
Sourcefn quick_switch_buffer(&mut self) -> String
fn quick_switch_buffer(&mut self) -> String
Quick switch to the last used buffer
Sourcefn close_buffer(&mut self) -> (bool, String)
fn close_buffer(&mut self) -> (bool, String)
Close the current buffer
Sourcefn switch_to_buffer(&mut self, index: usize) -> String
fn switch_to_buffer(&mut self, index: usize) -> String
Switch to a specific buffer by index
Sourcefn buffer_count(&self) -> usize
fn buffer_count(&self) -> usize
Get the total number of buffers
Sourcefn current_buffer_index(&self) -> usize
fn current_buffer_index(&self) -> usize
Get the current buffer index
Provided Methods§
Sourcefn new_buffer(&mut self)
fn new_buffer(&mut self)
Create a new buffer with current config settings