Struct scl_webview::WebView
source · pub struct WebView { /* private fields */ }
Expand description
一个可以显示单个浏览器窗口的对象
通过设置链接回调来获取对应的链接
Implementations§
source§impl WebView
impl WebView
sourcepub fn set_fixed_size(&mut self, s: (u32, u32))
pub fn set_fixed_size(&mut self, s: (u32, u32))
固定窗口大小
sourcepub fn fixed_size(self, s: (u32, u32)) -> Self
pub fn fixed_size(self, s: (u32, u32)) -> Self
固定窗口大小
sourcepub fn set_on_url_change(&mut self, f: fn(_: &str) -> bool)
pub fn set_on_url_change(&mut self, f: fn(_: &str) -> bool)
设置一个链接变更回调函数,如果函数返回 true
则会关闭 WebView 并返回该链接
反之则继续运行 WebView
sourcepub fn set_begin_url(&mut self, url: String)
pub fn set_begin_url(&mut self, url: String)
设置第一个打开的链接
sourcepub fn on_url_change(self, f: fn(_: &str) -> bool) -> Self
pub fn on_url_change(self, f: fn(_: &str) -> bool) -> Self
设置一个链接变更回调函数,如果函数返回 true
则会关闭 WebView 并返回该链接
反之则继续运行 WebView
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for WebView
impl Send for WebView
impl Sync for WebView
impl Unpin for WebView
impl UnwindSafe for WebView
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