pub struct Target { /* private fields */ }Implementations§
Source§impl Target
impl Target
Sourcepub fn new(
info: TargetInfo,
config: TargetConfig,
browser_context: BrowserContext,
) -> Self
pub fn new( info: TargetInfo, config: TargetConfig, browser_context: BrowserContext, ) -> Self
Create a new target instance with TargetInfo after a
CreateTargetParams request.
Sourcepub fn set_session_id(&mut self, id: SessionId)
pub fn set_session_id(&mut self, id: SessionId)
Set the session id.
Sourcepub fn session_id(&self) -> Option<&SessionId>
pub fn session_id(&self) -> Option<&SessionId>
Get the session id.
Sourcepub fn session_id_mut(&mut self) -> &mut Option<SessionId>
pub fn session_id_mut(&mut self) -> &mut Option<SessionId>
Get the session id mut.
Sourcepub fn browser_context(&self) -> &BrowserContext
pub fn browser_context(&self) -> &BrowserContext
Get the browser context.
Sourcepub fn type(&self) -> &TargetType
pub fn type(&self) -> &TargetType
The type of this target
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Whether this target is already initialized
Sourcepub fn goto(&mut self, req: FrameRequestedNavigation)
pub fn goto(&mut self, req: FrameRequestedNavigation)
Navigate a frame
Sourcepub fn browser_context_id(&self) -> Option<&BrowserContextId>
pub fn browser_context_id(&self) -> Option<&BrowserContextId>
The browser context ID.
Sourcepub fn info(&self) -> &TargetInfo
pub fn info(&self) -> &TargetInfo
The target connection info.
Sourcepub fn opener_id(&self) -> Option<&TargetId>
pub fn opener_id(&self) -> Option<&TargetId>
Get the target that opened this target. Top-level targets return None.
pub fn frame_manager(&self) -> &FrameManager
Sourcepub fn frame_manager_mut(&mut self) -> &mut FrameManager
pub fn frame_manager_mut(&mut self) -> &mut FrameManager
The frame manager.
Sourcepub fn event_listeners_mut(&mut self) -> &mut EventListeners
pub fn event_listeners_mut(&mut self) -> &mut EventListeners
Get event listeners mutably.
Sourcepub fn on_response(&mut self, resp: Response, method: &str)
pub fn on_response(&mut self, resp: Response, method: &str)
Received a response to a command issued by this target
Sourcepub fn on_event(&mut self, event: CdpEventMessage)
pub fn on_event(&mut self, event: CdpEventMessage)
On CDP Event message.
Sourcepub fn set_initiator(&mut self, tx: Sender<Result<Page>>)
pub fn set_initiator(&mut self, tx: Sender<Result<Page>>)
Set the sender half of the channel who requested the creation of this target
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Target
impl !RefUnwindSafe for Target
impl Send for Target
impl !Sync for Target
impl Unpin for Target
impl !UnwindSafe for Target
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