pub struct SnapshotGenerator { /* private fields */ }Expand description
Headless snapshot generator
Integrates all components to generate snapshots needed for UI rendering
Implementations§
Source§impl SnapshotGenerator
impl SnapshotGenerator
Sourcepub fn from_text_with_tab_width(
text: &str,
viewport_width: usize,
tab_width: usize,
) -> Self
pub fn from_text_with_tab_width( text: &str, viewport_width: usize, tab_width: usize, ) -> Self
Initialize from text, with explicit tab_width (in cells) for expanding '\t'.
Sourcepub fn set_viewport_width(&mut self, width: usize)
pub fn set_viewport_width(&mut self, width: usize)
Set viewport width
Sourcepub fn set_tab_width(&mut self, tab_width: usize)
pub fn set_tab_width(&mut self, tab_width: usize)
Set tab width (in cells) used for expanding '\t'.
Sourcepub fn get_headless_grid(
&self,
start_visual_row: usize,
count: usize,
) -> HeadlessGrid
pub fn get_headless_grid( &self, start_visual_row: usize, count: usize, ) -> HeadlessGrid
Get headless grid snapshot
This is the core API, returning visual line data for the specified range
Sourcepub fn get_line(&self, line_index: usize) -> Option<&str>
pub fn get_line(&self, line_index: usize) -> Option<&str>
Get content of a specific logical line
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Get total number of logical lines
Auto Trait Implementations§
impl Freeze for SnapshotGenerator
impl RefUnwindSafe for SnapshotGenerator
impl Send for SnapshotGenerator
impl Sync for SnapshotGenerator
impl Unpin for SnapshotGenerator
impl UnwindSafe for SnapshotGenerator
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