pub struct TabManager { /* private fields */ }Expand description
Manages the state of all browser tabs connected via the extension.
Implementations§
Source§impl TabManager
impl TabManager
pub fn new() -> Self
Sourcepub async fn register_pending(
&self,
tab_id: u32,
command_id: &str,
) -> Option<Receiver<Value>>
pub async fn register_pending( &self, tab_id: u32, command_id: &str, ) -> Option<Receiver<Value>>
Register a pending command and return a receiver for the response.
Sourcepub async fn resolve_pending(
&self,
tab_id: u32,
command_id: &str,
value: Value,
) -> bool
pub async fn resolve_pending( &self, tab_id: u32, command_id: &str, value: Value, ) -> bool
Resolve a pending command with a response value.
Sourcepub async fn resolve_tab(&self, tab_id: Option<u32>) -> Result<u32, TabError>
pub async fn resolve_tab(&self, tab_id: Option<u32>) -> Result<u32, TabError>
Get the target tab ID, resolving None to the active tab.
§Errors
Returns an error if no active tab is set or the specified tab doesn’t exist.
pub async fn on_tab_created(&self, tab_id: u32, url: &str, title: &str)
pub async fn on_tab_closed(&self, tab_id: u32)
pub async fn on_tab_activated(&self, tab_id: u32)
pub async fn on_tab_updated( &self, tab_id: u32, url: Option<&str>, title: Option<&str>, )
pub async fn on_bridge_ready(&self, tab_id: u32)
pub async fn get_active_tab_id(&self) -> u32
pub async fn tab_count(&self) -> usize
pub async fn is_bridge_ready(&self, tab_id: u32) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TabManager
impl !RefUnwindSafe for TabManager
impl Send for TabManager
impl Sync for TabManager
impl Unpin for TabManager
impl UnsafeUnpin for TabManager
impl !UnwindSafe for TabManager
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