pub struct ContentView {
pub lines: Vec<Line<'static>>,
pub link_positions: Vec<(usize, usize)>,
pub scroll_offset: usize,
pub selected_link: Option<usize>,
}Expand description
HTML コンテンツを ratatui の Lines に変換して保持し、スクロールとリンク選択を管理する。
Fields§
§lines: Vec<Line<'static>>§link_positions: Vec<(usize, usize)>(line_index, link_index) のペア。リンクが存在する行とそのリンク番号の対応
scroll_offset: usize§selected_link: Option<usize>Implementations§
Source§impl ContentView
impl ContentView
pub fn from_content(content: &ExtractedContent) -> Self
pub fn total_lines(&self) -> usize
pub fn scroll_down(&mut self, n: usize, viewport_height: usize)
pub fn scroll_up(&mut self, n: usize)
pub fn scroll_to_top(&mut self)
pub fn scroll_to_bottom(&mut self, viewport_height: usize)
pub fn next_link(&mut self)
pub fn prev_link(&mut self)
pub fn selected_link_url<'a>( &self, links: &'a [ExtractedLink], ) -> Option<&'a Url>
Auto Trait Implementations§
impl Freeze for ContentView
impl RefUnwindSafe for ContentView
impl Send for ContentView
impl Sync for ContentView
impl Unpin for ContentView
impl UnsafeUnpin for ContentView
impl UnwindSafe for ContentView
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<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