pub struct BrowserContext {
pub id: String,
pub config: ContextConfig,
pub state: ContextState,
pub created_at: Instant,
pub error_message: Option<String>,
/* private fields */
}Expand description
A browser context instance
Fields§
§id: StringContext ID
config: ContextConfigConfiguration
state: ContextStateCurrent state
created_at: InstantCreation time
error_message: Option<String>Error message if state is Error
Implementations§
Source§impl BrowserContext
impl BrowserContext
Sourcepub fn new(id: &str, config: ContextConfig) -> Self
pub fn new(id: &str, config: ContextConfig) -> Self
Create a new context
Sourcepub const fn is_available(&self) -> bool
pub const fn is_available(&self) -> bool
Check if context is available
Sourcepub fn close_page(&self, page_id: &str)
pub fn close_page(&self, page_id: &str)
Close a page
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Get page count
Sourcepub fn storage_state(&self) -> StorageState
pub fn storage_state(&self) -> StorageState
Get storage state
Sourcepub fn clear_storage(&self)
pub fn clear_storage(&self)
Clear storage
Add cookie
Clear cookies
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BrowserContext
impl RefUnwindSafe for BrowserContext
impl Send for BrowserContext
impl Sync for BrowserContext
impl Unpin for BrowserContext
impl UnsafeUnpin for BrowserContext
impl UnwindSafe for BrowserContext
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