pub struct Tab { /* private fields */ }Expand description
Tab はブラウザで開かれた 1 つのページを表す構造体です。
主な責務:
- 現在表示しているページのタイトルの保持
- ページ内容を扱う WebView の保持
WebView が「ページそのもの」の状態を管理するのに対し、 Tab は UI 上のタブとしてのメタ情報(タイトルなど)を管理します。
TODO:
- ページの状態(Error、loading)の管理を追加
Implementations§
Source§impl Tab
impl Tab
pub fn new() -> Self
Sourcepub fn tick(&mut self) -> Vec<TabTask>
pub fn tick(&mut self) -> Vec<TabTask>
Tab 内の状態を 1 ステップ進める
- WebView.tick() を呼び出す
- 発生した Task を BrowserApp に返す
Sourcepub fn on_css_fetched(&mut self, css: String)
pub fn on_css_fetched(&mut self, css: String)
BrowserApp から CSS fetch 完了を通知
Sourcepub fn on_fetch_succeeded_html(&mut self, html: String)
pub fn on_fetch_succeeded_html(&mut self, html: String)
BrowserApp からの HTML fetch 完了を通知
pub fn on_fetch_succeeded_css(&mut self, css: String)
Sourcepub fn on_fetch_failed(&mut self, err: BrowserNetworkError, failed_url: Url)
pub fn on_fetch_failed(&mut self, err: BrowserNetworkError, failed_url: Url)
Display error page on fetch failure
pub fn move_to(&mut self, href: &str)
pub fn relayout(&mut self, viewport: (f32, f32))
Sourcepub fn layout_and_info_mut(&mut self) -> Option<(&LayoutNode, &mut InfoNode)>
pub fn layout_and_info_mut(&mut self) -> Option<(&LayoutNode, &mut InfoNode)>
Returns layout_and_info Only InfoNode will be mutable.
Sourcepub fn document_url(&self) -> Option<Url>
pub fn document_url(&self) -> Option<Url>
Returns document url
pub fn layout_and_info(&self) -> Option<(&LayoutNode, &InfoNode)>
pub fn needs_redraw(&self) -> bool
pub fn clear_redraw_flag(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tab
impl !RefUnwindSafe for Tab
impl !Send for Tab
impl !Sync for Tab
impl Unpin for Tab
impl !UnwindSafe for Tab
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
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().