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.
pub fn set_session_id(&mut self, id: SessionId)
pub fn session_id(&self) -> Option<&SessionId>
pub fn browser_context(&self) -> &BrowserContext
pub fn session_id_mut(&mut self) -> &mut Option<SessionId>
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
pub fn is_page(&self) -> bool
pub fn browser_context_id(&self) -> Option<&BrowserContextId>
pub fn info(&self) -> &TargetInfo
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
pub fn frame_manager_mut(&mut self) -> &mut FrameManager
pub fn event_listeners_mut(&mut self) -> &mut EventListeners
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
pub fn on_event(&mut self, event: CdpEventMessage)
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more