pub struct Locator { /* private fields */ }Expand description
Puppeteer’s Locator (puppeteer-core 25.10.0), a remote object
served by browser-commander serve --stdio.
Extends EventEmitter; the inherited methods are repeated here.
Implementations§
Source§impl Locator
impl Locator
Sourcepub async fn on(
&self,
type_: Value,
handler: impl Into<JsFunction>,
) -> Result<Locator, BridgeError>
pub async fn on( &self, type_: Value, handler: impl Into<JsFunction>, ) -> Result<Locator, BridgeError>
EventEmitter.on
on<Key extends keyof EventsWithWildcard<Events>>(type: Key, handler: Handler<EventsWithWildcard<Events>[Key]>): thisSourcepub async fn off(
&self,
type_: Value,
handler: Option<JsFunction>,
) -> Result<Locator, BridgeError>
pub async fn off( &self, type_: Value, handler: Option<JsFunction>, ) -> Result<Locator, BridgeError>
EventEmitter.off
off<Key extends keyof EventsWithWildcard<Events>>(type: Key, handler?: Handler<EventsWithWildcard<Events>[Key]>): thisSourcepub async fn emit(
&self,
type_: Value,
event: Value,
) -> Result<bool, BridgeError>
pub async fn emit( &self, type_: Value, event: Value, ) -> Result<bool, BridgeError>
EventEmitter.emit
emit<Key extends keyof EventsWithWildcard<Events>>(type: Key, event: EventsWithWildcard<Events>[Key]): booleanSourcepub async fn once(
&self,
type_: Value,
handler: impl Into<JsFunction>,
) -> Result<Locator, BridgeError>
pub async fn once( &self, type_: Value, handler: impl Into<JsFunction>, ) -> Result<Locator, BridgeError>
EventEmitter.once
once<Key extends keyof EventsWithWildcard<Events>>(type: Key, handler: Handler<EventsWithWildcard<Events>[Key]>): thisSourcepub async fn listener_count(&self, type_: Value) -> Result<f64, BridgeError>
pub async fn listener_count(&self, type_: Value) -> Result<f64, BridgeError>
EventEmitter.listenerCount
listenerCount(type: keyof EventsWithWildcard<Events>): numberSourcepub async fn remove_all_listeners(
&self,
type_: Option<Value>,
) -> Result<Locator, BridgeError>
pub async fn remove_all_listeners( &self, type_: Option<Value>, ) -> Result<Locator, BridgeError>
EventEmitter.removeAllListeners
removeAllListeners(type?: keyof EventsWithWildcard<Events>): thisSourcepub async fn timeout(&self) -> Result<f64, BridgeError>
pub async fn timeout(&self) -> Result<f64, BridgeError>
Locator.timeout
get timeout(): numberSourcepub async fn set_timeout(&self, timeout: f64) -> Result<Locator, BridgeError>
pub async fn set_timeout(&self, timeout: f64) -> Result<Locator, BridgeError>
Locator.setTimeout
setTimeout(timeout: number): Locator<T>Sourcepub async fn set_visibility(
&self,
this: &Locator,
visibility: Option<&str>,
) -> Result<Locator, BridgeError>
pub async fn set_visibility( &self, this: &Locator, visibility: Option<&str>, ) -> Result<Locator, BridgeError>
Locator.setVisibility
setVisibility<NodeType extends Node>(this: Locator<NodeType>, visibility: VisibilityOption): Locator<NodeType>Sourcepub async fn set_wait_for_enabled(
&self,
this: &Locator,
value: bool,
) -> Result<Locator, BridgeError>
pub async fn set_wait_for_enabled( &self, this: &Locator, value: bool, ) -> Result<Locator, BridgeError>
Locator.setWaitForEnabled
setWaitForEnabled<NodeType extends Node>(this: Locator<NodeType>, value: boolean): Locator<NodeType>Sourcepub async fn set_ensure_element_is_in_the_viewport(
&self,
this: &Locator,
value: bool,
) -> Result<Locator, BridgeError>
pub async fn set_ensure_element_is_in_the_viewport( &self, this: &Locator, value: bool, ) -> Result<Locator, BridgeError>
Locator.setEnsureElementIsInTheViewport
setEnsureElementIsInTheViewport<ElementType extends Element>(this: Locator<ElementType>, value: boolean): Locator<ElementType>Sourcepub async fn set_wait_for_stable_bounding_box(
&self,
this: &Locator,
value: bool,
) -> Result<Locator, BridgeError>
pub async fn set_wait_for_stable_bounding_box( &self, this: &Locator, value: bool, ) -> Result<Locator, BridgeError>
Locator.setWaitForStableBoundingBox
setWaitForStableBoundingBox<ElementType extends Element>(this: Locator<ElementType>, value: boolean): Locator<ElementType>Sourcepub async fn js_clone(&self) -> Result<Locator, BridgeError>
pub async fn js_clone(&self) -> Result<Locator, BridgeError>
Locator.clone
clone(): Locator<T>Sourcepub async fn wait_handle(
&self,
options: Option<Value>,
) -> Result<JSHandle, BridgeError>
pub async fn wait_handle( &self, options: Option<Value>, ) -> Result<JSHandle, BridgeError>
Locator.waitHandle
waitHandle(options?: Readonly<ActionOptions>): Promise<HandleFor<T>>Sourcepub async fn wait(&self, options: Option<Value>) -> Result<Value, BridgeError>
pub async fn wait(&self, options: Option<Value>) -> Result<Value, BridgeError>
Locator.wait
wait(options?: Readonly<ActionOptions>): Promise<T>Sourcepub async fn map(
&self,
mapper: impl Into<JsFunction>,
) -> Result<Locator, BridgeError>
pub async fn map( &self, mapper: impl Into<JsFunction>, ) -> Result<Locator, BridgeError>
Locator.map
map<To>(mapper: Mapper<T, To>): Locator<To>Sourcepub async fn filter(
&self,
predicate: impl Into<JsFunction>,
) -> Result<Locator, BridgeError>
pub async fn filter( &self, predicate: impl Into<JsFunction>, ) -> Result<Locator, BridgeError>
Locator.filter
filter<S extends T>(predicate: Predicate<T, S>): Locator<S>Sourcepub async fn click(
&self,
this: &Locator,
options: Option<Value>,
) -> Result<(), BridgeError>
pub async fn click( &self, this: &Locator, options: Option<Value>, ) -> Result<(), BridgeError>
Locator.click
click<ElementType extends Element>(this: Locator<ElementType>, options?: Readonly<LocatorClickOptions>): Promise<void>Sourcepub async fn fill(
&self,
this: &Locator,
value: Value,
options: Option<Value>,
) -> Result<(), BridgeError>
pub async fn fill( &self, this: &Locator, value: Value, options: Option<Value>, ) -> Result<(), BridgeError>
Locator.fill
fill<ElementType extends Element>(this: Locator<ElementType>, value: string | boolean, options?: Readonly<LocatorFillOptions>): Promise<void>Trait Implementations§
Source§impl FromWire for Locator
impl FromWire for Locator
Source§fn from_wire(client: &BridgeClient, value: Value) -> Result<Self, BridgeError>
fn from_wire(client: &BridgeClient, value: Value) -> Result<Self, BridgeError>
Convert, failing with
BridgeError::Decode on a type mismatch.Source§impl Remote for Locator
impl Remote for Locator
Source§fn from_remote(remote: RemoteHandle) -> Self
fn from_remote(remote: RemoteHandle) -> Self
Wrap a handle without checking its type.
Source§fn remote(&self) -> &RemoteHandle
fn remote(&self) -> &RemoteHandle
The handle behind the wrapper.
impl StructuralPartialEq for Locator
Auto Trait Implementations§
impl !RefUnwindSafe for Locator
impl !UnwindSafe for Locator
impl Freeze for Locator
impl Send for Locator
impl Sync for Locator
impl Unpin for Locator
impl UnsafeUnpin for Locator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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