pub struct Browser { /* private fields */ }Implementations§
Source§impl Browser
impl Browser
Sourcepub async fn new() -> Result<Self>
pub async fn new() -> Result<Self>
Launches a new headless browser instance using the default browser path.
Sourcepub async fn new_with_path(path: impl AsRef<Path>) -> Result<Self>
pub async fn new_with_path(path: impl AsRef<Path>) -> Result<Self>
Launches a new headless browser instance using a custom executable path.
Sourcepub async fn new_with_head() -> Result<Self>
pub async fn new_with_head() -> Result<Self>
Launches a new browser instance with head visible using the default browser path.
Sourcepub async fn new_with_head_and_path(path: impl AsRef<Path>) -> Result<Self>
pub async fn new_with_head_and_path(path: impl AsRef<Path>) -> Result<Self>
Launches a new browser instance with head visible using a custom executable path.
pub async fn new_tab(&self) -> Result<Tab>
pub async fn capture_html(&self, html: &str, selector: &str) -> Result<String>
pub async fn capture_html_with_options( &self, html: &str, selector: &str, opts: CaptureOptions, ) -> Result<String>
pub async fn capture_html_hidpi( &self, html: &str, selector: &str, scale: f64, ) -> Result<String>
pub async fn shutdown_global()
pub async fn close_async(&self) -> Result<()>
Sourcepub async fn instance() -> Self
pub async fn instance() -> Self
Returns a shared singleton browser instance, launching if necessary.
Sourcepub async fn instance_with_path(path: impl AsRef<Path>) -> Self
pub async fn instance_with_path(path: impl AsRef<Path>) -> Self
Returns a shared singleton browser instance, launching with the specified path if necessary.
Note: If the global browser instance is already running, this path argument will be ignored and the existing instance will be returned.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Browser
impl !UnwindSafe for Browser
impl Freeze for Browser
impl Send for Browser
impl Sync for Browser
impl Unpin for Browser
impl UnsafeUnpin for Browser
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