pub struct Buffer {Show 34 fields
pub id: usize,
pub file_path: Option<PathBuf>,
pub name: String,
pub modified: bool,
pub datatable: Option<Arc<DataTable>>,
pub original_source: Option<Arc<DataTable>>,
pub dataview: Option<DataView>,
pub mode: AppMode,
pub edit_mode: EditMode,
pub input: Input,
pub input_manager: Box<dyn InputManager>,
pub table_state: TableState,
pub last_results_row: Option<usize>,
pub last_scroll_offset: (usize, usize),
pub last_query: String,
pub status_message: String,
pub sort_state: SortState,
pub filter_state: FilterState,
pub fuzzy_filter_state: FuzzyFilterState,
pub search_state: SearchState,
pub column_stats: Option<ColumnStatistics>,
pub view_state: ViewState,
pub column_widths: Vec<u16>,
pub compact_mode: bool,
pub show_row_numbers: bool,
pub case_insensitive: bool,
pub undo_stack: Vec<(String, usize)>,
pub redo_stack: Vec<(String, usize)>,
pub kill_ring: String,
pub last_visible_rows: usize,
pub last_query_source: Option<String>,
pub highlighted_text_cache: Option<Vec<(String, Color)>>,
pub last_highlighted_text: String,
pub saved_input_state: Option<(String, usize)>,
}
Expand description
Represents a single buffer/tab with its own independent state
Fields§
§id: usize
Unique identifier for this buffer
file_path: Option<PathBuf>
File path if loaded from file
name: String
Display name (filename or “untitled”)
modified: bool
Whether this buffer has unsaved changes
datatable: Option<Arc<DataTable>>
§original_source: Option<Arc<DataTable>>
Original unmodified DataTable (preserved for query operations)
dataview: Option<DataView>
DataView for applying filters like hidden columns without modifying the DataTable
mode: AppMode
§edit_mode: EditMode
§input: Input
§input_manager: Box<dyn InputManager>
§table_state: TableState
§last_results_row: Option<usize>
§last_scroll_offset: (usize, usize)
§last_query: String
§status_message: String
§sort_state: SortState
§filter_state: FilterState
§fuzzy_filter_state: FuzzyFilterState
§search_state: SearchState
§column_stats: Option<ColumnStatistics>
§view_state: ViewState
§column_widths: Vec<u16>
§compact_mode: bool
§show_row_numbers: bool
§case_insensitive: bool
§undo_stack: Vec<(String, usize)>
§redo_stack: Vec<(String, usize)>
§kill_ring: String
§last_visible_rows: usize
§last_query_source: Option<String>
§highlighted_text_cache: Option<Vec<(String, Color)>>
§last_highlighted_text: String
§saved_input_state: Option<(String, usize)>
Implementations§
Source§impl Buffer
impl Buffer
Sourcepub fn from_csv(
id: usize,
path: PathBuf,
_csv_client: CsvApiClient,
_table_name: String,
) -> Self
pub fn from_csv( id: usize, path: PathBuf, _csv_client: CsvApiClient, _table_name: String, ) -> Self
Create a buffer from a CSV file
Sourcepub fn from_json(
id: usize,
path: PathBuf,
_csv_client: CsvApiClient,
_table_name: String,
) -> Self
pub fn from_json( id: usize, path: PathBuf, _csv_client: CsvApiClient, _table_name: String, ) -> Self
Create a buffer from a JSON file
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get display name for tab bar
Sourcepub fn short_name(&self, max_len: usize) -> String
pub fn short_name(&self, max_len: usize) -> String
Get short name for tab bar (truncated if needed)
Sourcepub fn move_cursor_word_backward(&mut self)
pub fn move_cursor_word_backward(&mut self)
Move cursor to previous word boundary
Sourcepub fn move_cursor_word_forward(&mut self)
pub fn move_cursor_word_forward(&mut self)
Move cursor to next word boundary
Sourcepub fn delete_word_backward(&mut self)
pub fn delete_word_backward(&mut self)
Delete word backward from cursor
Sourcepub fn delete_word_forward(&mut self)
pub fn delete_word_forward(&mut self)
Delete word forward from cursor
Sourcepub fn kill_line_backward(&mut self)
pub fn kill_line_backward(&mut self)
Kill line from start to cursor
Sourcepub fn jump_to_prev_token(&mut self)
pub fn jump_to_prev_token(&mut self)
Jump to previous SQL token
Sourcepub fn jump_to_next_token(&mut self)
pub fn jump_to_next_token(&mut self)
Jump to next SQL token
Sourcepub fn expand_asterisk(&mut self, parser: &HybridParser) -> bool
pub fn expand_asterisk(&mut self, parser: &HybridParser) -> bool
Expand SELECT * to column names using schema information
Sourcepub fn expand_asterisk_visible(&mut self) -> bool
pub fn expand_asterisk_visible(&mut self) -> bool
Expand SELECT * to only visible column names
Trait Implementations§
Source§impl BufferAPI for Buffer
impl BufferAPI for Buffer
fn get_id(&self) -> usize
fn get_query(&self) -> String
fn set_query(&mut self, query: String)
fn get_last_query(&self) -> String
fn set_last_query(&mut self, query: String)
fn get_datatable(&self) -> Option<&DataTable>
fn get_datatable_mut(&mut self) -> Option<&mut DataTable>
fn has_datatable(&self) -> bool
fn get_original_source(&self) -> Option<&DataTable>
fn set_datatable(&mut self, datatable: Option<Arc<DataTable>>)
Source§fn set_results_as_datatable(
&mut self,
response: Option<QueryResponse>,
) -> Result<(), String>
fn set_results_as_datatable( &mut self, response: Option<QueryResponse>, ) -> Result<(), String>
fn get_dataview(&self) -> Option<&DataView>
fn get_dataview_mut(&mut self) -> Option<&mut DataView>
fn set_dataview(&mut self, dataview: Option<DataView>)
fn has_dataview(&self) -> bool
fn get_mode(&self) -> AppMode
fn set_mode(&mut self, mode: AppMode)
fn get_edit_mode(&self) -> EditMode
fn set_edit_mode(&mut self, mode: EditMode)
fn get_status_message(&self) -> String
fn set_status_message(&mut self, message: String)
fn get_selected_row(&self) -> Option<usize>
fn set_selected_row(&mut self, row: Option<usize>)
fn get_current_column(&self) -> usize
fn set_current_column(&mut self, col: usize)
fn get_scroll_offset(&self) -> (usize, usize)
fn set_scroll_offset(&mut self, offset: (usize, usize))
fn get_last_results_row(&self) -> Option<usize>
fn set_last_results_row(&mut self, row: Option<usize>)
fn get_last_scroll_offset(&self) -> (usize, usize)
fn set_last_scroll_offset(&mut self, offset: (usize, usize))
fn get_filter_pattern(&self) -> String
fn set_filter_pattern(&mut self, pattern: String)
fn is_filter_active(&self) -> bool
fn set_filter_active(&mut self, active: bool)
fn get_fuzzy_filter_pattern(&self) -> String
fn set_fuzzy_filter_pattern(&mut self, pattern: String)
fn is_fuzzy_filter_active(&self) -> bool
fn set_fuzzy_filter_active(&mut self, active: bool)
fn get_fuzzy_filter_indices(&self) -> &Vec<usize>
fn set_fuzzy_filter_indices(&mut self, indices: Vec<usize>)
fn clear_fuzzy_filter(&mut self)
fn get_search_pattern(&self) -> String
fn set_search_pattern(&mut self, pattern: String)
fn get_search_matches(&self) -> Vec<(usize, usize)>
fn set_search_matches(&mut self, matches: Vec<(usize, usize)>)
fn get_current_match(&self) -> Option<(usize, usize)>
fn set_current_match(&mut self, match_pos: Option<(usize, usize)>)
fn get_search_match_index(&self) -> usize
fn set_search_match_index(&mut self, index: usize)
fn clear_search_state(&mut self)
fn get_column_stats(&self) -> Option<&ColumnStatistics>
fn set_column_stats(&mut self, stats: Option<ColumnStatistics>)
fn get_sort_column(&self) -> Option<usize>
fn set_sort_column(&mut self, column: Option<usize>)
fn get_sort_order(&self) -> SortOrder
fn set_sort_order(&mut self, order: SortOrder)
fn is_compact_mode(&self) -> bool
fn set_compact_mode(&mut self, compact: bool)
fn is_show_row_numbers(&self) -> bool
fn set_show_row_numbers(&mut self, show: bool)
fn is_viewport_lock(&self) -> bool
fn set_viewport_lock(&mut self, locked: bool)
fn get_viewport_lock_row(&self) -> Option<usize>
fn set_viewport_lock_row(&mut self, row: Option<usize>)
fn get_column_widths(&self) -> &Vec<u16>
fn set_column_widths(&mut self, widths: Vec<u16>)
fn is_case_insensitive(&self) -> bool
fn set_case_insensitive(&mut self, case_insensitive: bool)
fn get_name(&self) -> String
fn set_name(&mut self, name: String)
fn get_file_path(&self) -> Option<&PathBuf>
fn set_file_path(&mut self, path: Option<String>)
fn is_modified(&self) -> bool
fn set_modified(&mut self, modified: bool)
fn get_last_query_source(&self) -> Option<String>
fn set_last_query_source(&mut self, source: Option<String>)
fn get_input_value(&self) -> String
fn set_input_value(&mut self, value: String)
fn get_input_cursor(&self) -> usize
fn set_input_cursor(&mut self, pos: usize)
fn apply_filter(&mut self) -> Result<()>
fn apply_sort(&mut self) -> Result<()>
fn search(&mut self) -> Result<()>
fn clear_filters(&mut self)
fn get_row_count(&self) -> usize
fn get_column_count(&self) -> usize
fn get_column_names(&self) -> Vec<String>
fn get_undo_stack(&self) -> &Vec<(String, usize)>
fn push_undo(&mut self, state: (String, usize))
fn pop_undo(&mut self) -> Option<(String, usize)>
fn get_redo_stack(&self) -> &Vec<(String, usize)>
fn push_redo(&mut self, state: (String, usize))
fn pop_redo(&mut self) -> Option<(String, usize)>
fn clear_redo(&mut self)
fn perform_undo(&mut self) -> bool
fn perform_redo(&mut self) -> bool
fn save_state_for_undo(&mut self)
fn get_kill_ring(&self) -> String
fn set_kill_ring(&mut self, text: String)
fn is_kill_ring_empty(&self) -> bool
fn get_last_visible_rows(&self) -> usize
fn set_last_visible_rows(&mut self, rows: usize)
fn debug_dump(&self) -> String
fn get_input_text(&self) -> String
fn set_input_text(&mut self, text: String)
fn handle_input_key(&mut self, event: KeyEvent) -> bool
fn switch_input_mode(&mut self, _multiline: bool)
fn get_input_cursor_position(&self) -> usize
fn set_input_cursor_position(&mut self, position: usize)
fn is_input_multiline(&self) -> bool
fn clear_results(&mut self)
Source§impl StateCoordinator for Buffer
impl StateCoordinator for Buffer
Source§fn process_event(&self, event: &StateEvent) -> StateChange
fn process_event(&self, event: &StateEvent) -> StateChange
Source§fn apply_change(&mut self, change: StateChange)
fn apply_change(&mut self, change: StateChange)
Source§fn emit_event(&self, event: StateEvent)
fn emit_event(&self, event: StateEvent)
Auto Trait Implementations§
impl !Freeze for Buffer
impl !RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl !UnwindSafe for Buffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more