pub struct FileState {
pub content: Vec<String>,
pub window_start: usize,
pub window_size: usize,
pub modified: bool,
pub last_modified: Option<SystemTime>,
}Expand description
State of an individual file
Fields§
§content: Vec<String>File content as lines
window_start: usizeCurrent window start position (0-indexed line number)
window_size: usizeWindow size (number of lines to show)
modified: boolFile modification tracking
last_modified: Option<SystemTime>Last modification timestamp
Implementations§
Source§impl FileState
impl FileState
Sourcepub fn get_window(&self) -> Vec<&String>
pub fn get_window(&self) -> Vec<&String>
Get the current window content
Sourcepub fn get_window_with_line_numbers(&self) -> Vec<String>
pub fn get_window_with_line_numbers(&self) -> Vec<String>
Get window with line numbers
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll window down
Sourcepub fn total_lines(&self) -> usize
pub fn total_lines(&self) -> usize
Get total number of lines
Sourcepub fn is_at_start(&self) -> bool
pub fn is_at_start(&self) -> bool
Check if window is at the beginning
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileState
impl<'de> Deserialize<'de> for FileState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileState
impl RefUnwindSafe for FileState
impl Send for FileState
impl Sync for FileState
impl Unpin for FileState
impl UnsafeUnpin for FileState
impl UnwindSafe for FileState
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
Mutably borrows from an owned value. Read more