pub struct HelpApp {
pub active_tab: usize,
pub tab_count: usize,
pub total_lines: usize,
/* private fields */
}Expand description
HelpApp 状态
Fields§
§active_tab: usize§tab_count: usize§total_lines: usize当前 Tab 的总渲染行数(用于滚动限制)
Implementations§
Source§impl HelpApp
impl HelpApp
pub fn new() -> Self
pub fn tab_name(&self, idx: usize) -> &str
pub fn theme(&self) -> &Theme
Sourcepub fn current_tab_lines(&mut self, content_width: usize) -> &[Line<'static>]
pub fn current_tab_lines(&mut self, content_width: usize) -> &[Line<'static>]
获取当前 Tab 的渲染行(带缓存)
pub fn scroll_offset(&self) -> usize
pub fn next_tab(&mut self)
pub fn prev_tab(&mut self)
pub fn goto_tab(&mut self, idx: usize)
pub fn scroll_down(&mut self, n: usize)
pub fn scroll_up(&mut self, n: usize)
pub fn scroll_to_top(&mut self)
pub fn scroll_to_bottom(&mut self)
pub fn invalidate_cache(&mut self)
Sourcepub fn clamp_scroll(&mut self, visible_height: usize)
pub fn clamp_scroll(&mut self, visible_height: usize)
钳制滚动偏移(在 draw 后调用,确保不超出内容范围)
Auto Trait Implementations§
impl Freeze for HelpApp
impl RefUnwindSafe for HelpApp
impl Send for HelpApp
impl Sync for HelpApp
impl Unpin for HelpApp
impl UnsafeUnpin for HelpApp
impl UnwindSafe for HelpApp
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
Converts
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>
Converts
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