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 from_text_with_options(
text: &str,
viewport_width: usize,
tab_width: usize,
wrap_mode: WrapMode,
) -> Self
pub fn from_text_with_options( text: &str, viewport_width: usize, tab_width: usize, wrap_mode: WrapMode, ) -> Self
Initialize from text, with explicit options.
Sourcepub fn from_text_with_layout_options(
text: &str,
viewport_width: usize,
tab_width: usize,
wrap_mode: WrapMode,
wrap_indent: WrapIndent,
) -> Self
pub fn from_text_with_layout_options( text: &str, viewport_width: usize, tab_width: usize, wrap_mode: WrapMode, wrap_indent: WrapIndent, ) -> Self
Initialize from text, with explicit layout options.
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 Forget for SnapshotGenerator
impl Freeze for SnapshotGenerator
impl Move for SnapshotGenerator
impl RefUnwindSafe for SnapshotGenerator
impl Send for SnapshotGeneratorwhere
RawVecInner: Send,
impl Sync for SnapshotGeneratorwhere
RawVecInner: Sync,
impl Unpin for SnapshotGenerator
impl UnsafeUnpin for SnapshotGeneratorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<VisualLineInfo>: UnsafeUnpin,
impl UnwindSafe for SnapshotGeneratorwhere
RawVecInner: UnwindSafe,
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