pub trait BrowserEngine: Send + Sync {
// Required methods
fn new_tab<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn BrowserTab>, BrowserError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), BrowserError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_alive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PageContent, BrowserError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn callback_registry(&self) -> Arc<TabCallbackRegistry> ⓘ { ... }
}Expand description
Factory for opening and managing browser tabs.
This trait is implemented by backends (e.g. oxibrowser-core) and
consumed by the tool layer via Arc<dyn BrowserEngine>.
Required Methods§
Sourcefn new_tab<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn BrowserTab>, BrowserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn new_tab<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn BrowserTab>, BrowserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open a new browser tab and return it.
Provided Methods§
Sourcefn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PageContent, BrowserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<PageContent, BrowserError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a URL and return page content (no tab management).
Sourcefn callback_registry(&self) -> Arc<TabCallbackRegistry> ⓘ
fn callback_registry(&self) -> Arc<TabCallbackRegistry> ⓘ
Access the engine’s per-tab callback registry.
Tools (e.g. BrowseTool) register per-tab callbacks keyed by
tab_id. The backend’s background event-drain task extracts
tab_id from each BrowserEvent and routes it to the correct
callback. Backends without event streaming return an empty
registry — set/invoke become no-ops.
Default implementation returns a fresh empty registry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".