pub struct StreamPanel<'a> { /* private fields */ }Expand description
A streaming log or code output panel with auto-scroll and optional line numbers.
Feed it lines via .lines() and control the scroll with .scroll_offset().
When follow_tail is true (default), new lines auto-scroll to the bottom.
Implementations§
Source§impl<'a> StreamPanel<'a>
impl<'a> StreamPanel<'a>
Sourcepub fn scroll_offset(self, offset: u16) -> Self
pub fn scroll_offset(self, offset: u16) -> Self
Sets the scroll offset from the bottom (0 = last line at bottom).
Sourcepub fn follow_tail(self, follow: bool) -> Self
pub fn follow_tail(self, follow: bool) -> Self
When true, the view follows the last line (default: true).
Sourcepub fn show_line_numbers(self, show: bool) -> Self
pub fn show_line_numbers(self, show: bool) -> Self
Shows line numbers in the gutter (default: false).
Sourcepub fn palette(self, palette: AislingPalette) -> Self
pub fn palette(self, palette: AislingPalette) -> Self
Sets the color palette.
Sourcepub fn render_with_interaction(
&self,
frame: &mut Frame<'_>,
id: impl Into<WidgetId>,
area: Rect,
)
pub fn render_with_interaction( &self, frame: &mut Frame<'_>, id: impl Into<WidgetId>, area: Rect, )
Renders into a Scrin frame and registers hit regions for visible rows.
Sourcepub fn hit_regions(&self, id: impl Into<WidgetId>, area: Rect) -> Vec<HitRegion>
pub fn hit_regions(&self, id: impl Into<WidgetId>, area: Rect) -> Vec<HitRegion>
Builds Scrin interaction metadata for the visible stream rows.
Sourcepub fn selectable_spans(
&self,
id: impl Into<WidgetId>,
area: Rect,
) -> Vec<SelectableSpan>
pub fn selectable_spans( &self, id: impl Into<WidgetId>, area: Rect, ) -> Vec<SelectableSpan>
Builds selectable spans for the visible stream text.
Sourcepub fn scroll_region(
&self,
id: impl Into<WidgetId>,
area: Rect,
) -> Option<(Rect, usize, Vec<ScrollRowHit>)>
pub fn scroll_region( &self, id: impl Into<WidgetId>, area: Rect, ) -> Option<(Rect, usize, Vec<ScrollRowHit>)>
Builds Scrin scroll-region metadata for visible stream rows.
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Returns the number of lines currently held.
Trait Implementations§
Source§impl<'a> Clone for StreamPanel<'a>
impl<'a> Clone for StreamPanel<'a>
Source§fn clone(&self) -> StreamPanel<'a>
fn clone(&self) -> StreamPanel<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for StreamPanel<'a>
impl<'a> Debug for StreamPanel<'a>
Source§impl Default for StreamPanel<'_>
impl Default for StreamPanel<'_>
Source§impl PartialEq for StreamPanel<'_>
impl PartialEq for StreamPanel<'_>
Auto Trait Implementations§
impl<'a> Freeze for StreamPanel<'a>
impl<'a> RefUnwindSafe for StreamPanel<'a>
impl<'a> Send for StreamPanel<'a>
impl<'a> Sync for StreamPanel<'a>
impl<'a> Unpin for StreamPanel<'a>
impl<'a> UnsafeUnpin for StreamPanel<'a>
impl<'a> UnwindSafe for StreamPanel<'a>
Blanket Implementations§
Source§impl<W> AislingExt for Wwhere
W: Widget,
impl<W> AislingExt for Wwhere
W: Widget,
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