pub struct RTCErrorEvent(/* private fields */);
Implementations§
Source§impl RTCErrorEvent
impl RTCErrorEvent
pub fn new( browser: &Browser, type_: &dyn ToJs<JsString>, eventInitDict: &dyn ToJs<RTCErrorEventInit>, ) -> RTCErrorEvent
pub fn get_error(&self) -> RTCError
pub fn set_error(&self, value: &RTCError)
pub fn get_prototype(browser: &Browser) -> RTCErrorEvent
pub fn set_prototype(browser: &Browser, value: &RTCErrorEvent)
Methods from Deref<Target = Event>§
pub fn stop_propagation(&self) -> JsNullish
pub fn stop_immediate_propagation(&self) -> JsNullish
pub fn prevent_default(&self) -> JsNullish
pub fn composed_path(&self) -> Array<EventTarget>
pub fn init_event( &self, type_: &dyn ToJs<JsString>, bubbles: &dyn ToJs<JsNullable<JsBoolean>>, cancelable: &dyn ToJs<JsNullable<JsBoolean>>, ) -> JsNullish
pub fn get_bubbling__phase(&self) -> JsNumber
pub fn set_bubbling__phase(&self, value: &dyn ToJs<JsNumber>)
pub fn get_at__target(&self) -> JsNumber
pub fn set_at__target(&self, value: &dyn ToJs<JsNumber>)
pub fn get_capturing__phase(&self) -> JsNumber
pub fn set_capturing__phase(&self, value: &dyn ToJs<JsNumber>)
pub fn get_none(&self) -> JsNumber
pub fn set_none(&self, value: &dyn ToJs<JsNumber>)
pub fn get_type(&self) -> JsString
pub fn set_type(&self, value: &dyn ToJs<JsString>)
pub fn get_time_stamp(&self) -> JsNumber
pub fn set_time_stamp(&self, value: &dyn ToJs<JsNumber>)
pub fn get_target(&self) -> JsNullable<EventTarget>
pub fn set_target(&self, value: &dyn ToJs<JsNullable<EventTarget>>)
pub fn get_src_element(&self) -> JsNullable<EventTarget>
pub fn set_src_element(&self, value: &dyn ToJs<JsNullable<EventTarget>>)
pub fn get_return_value(&self) -> JsBoolean
pub fn set_return_value(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_is_trusted(&self) -> JsBoolean
pub fn set_is_trusted(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_event_phase(&self) -> JsNumber
pub fn set_event_phase(&self, value: &dyn ToJs<JsNumber>)
pub fn get_default_prevented(&self) -> JsBoolean
pub fn set_default_prevented(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_current_target(&self) -> JsNullable<EventTarget>
pub fn set_current_target(&self, value: &dyn ToJs<JsNullable<EventTarget>>)
pub fn get_composed(&self) -> JsBoolean
pub fn set_composed(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_cancelable(&self) -> JsBoolean
pub fn set_cancelable(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_cancel_bubble(&self) -> JsBoolean
pub fn set_cancel_bubble(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_bubbles(&self) -> JsBoolean
pub fn set_bubbles(&self, value: &dyn ToJs<JsBoolean>)
Methods from Deref<Target = JsObject>§
Sourcepub fn js_get_field(&self, property: &dyn UseInJsCode) -> JsValue
pub fn js_get_field(&self, property: &dyn UseInJsCode) -> JsValue
Get a field value of in this object.
WSDOM provides built-in getters so you should use that instead when possible.
Use js_get_field
only when needed
fn example(browser: Browser) {
// you can get `window["location"]["href"]` like this
let href: JsValue = wsdom::dom::location(&browser).js_get_field(&"href");
// but you should use built-in getters instead
let href: JsString = wsdom::dom::location(&browser).get_href();
}
Sourcepub fn js_set_field(&self, property: &dyn UseInJsCode, value: &dyn UseInJsCode)
pub fn js_set_field(&self, property: &dyn UseInJsCode, value: &dyn UseInJsCode)
Set a field value of in this object.
WSDOM provides built-in setters so you should use that instead when possible.
Use js_set_field
only when needed
fn example(browser: Browser) {
// you can set `window["location"]["href"]` like this
wsdom::dom::location(&browser).js_set_field(&"href", &"https://example.com/");
// but you should use built-in setters instead
wsdom::dom::location(&browser).set_href(&"https://example.com");
}
Sourcepub fn js_call_method<'a>(
&'a self,
method_name: &'a str,
args: impl IntoIterator<Item = &'a dyn UseInJsCode>,
last_arg_variadic: bool,
) -> JsValue
pub fn js_call_method<'a>( &'a self, method_name: &'a str, args: impl IntoIterator<Item = &'a dyn UseInJsCode>, last_arg_variadic: bool, ) -> JsValue
Call a method on this object.
Most types in WSDOM already come with safe Rust wrappers for their methods, so you should use those instead.
fn example(browser: &Browser) {
let console = wsdom::dom::console(browser);
// you can call console.log like this
console.js_call_method("log", [&"hello" as &_], false);
// but the better way is to use
wsdom::dom::console(&browser).log(&[&"Hello" as &_]);
}
Be aware that the first argument (method_name
) is NOT escaped.
Set last_arg_variadic
to true
if you want to “spread” the last argument as obj.method(arg1, arg2, ...arg3)
.
Sourcepub fn js_call_self<'a>(
&'a self,
args: impl IntoIterator<Item = &'a dyn UseInJsCode>,
last_arg_variadic: bool,
) -> JsValue
pub fn js_call_self<'a>( &'a self, args: impl IntoIterator<Item = &'a dyn UseInJsCode>, last_arg_variadic: bool, ) -> JsValue
Call this object: obj()
.
Most types in WSDOM already come with safe Rust wrappers for their methods, so you should use those instead.
Methods from Deref<Target = JsValue>§
pub fn browser(&self) -> &Browser
Sourcepub fn retrieve_json(&self) -> RetrieveFuture<'_, Value>
pub fn retrieve_json(&self) -> RetrieveFuture<'_, Value>
Retrive this value from the JS side to the Rust side. Returns Future whose output is a serde_json::Value.
§use wsdom::dom::Browser
§use wsdom::dom::HTMLInputElement;
async fn example(input: &HTMLInputElement) { let _val = input.get_value().retrieve_json().await; }
Trait Implementations§
Source§impl AsRef<Event> for RTCErrorEvent
impl AsRef<Event> for RTCErrorEvent
Source§impl AsRef<JsObject> for RTCErrorEvent
impl AsRef<JsObject> for RTCErrorEvent
Source§impl AsRef<JsValue> for RTCErrorEvent
impl AsRef<JsValue> for RTCErrorEvent
Source§impl AsRef<RTCErrorEvent> for RTCErrorEvent
impl AsRef<RTCErrorEvent> for RTCErrorEvent
Source§impl Clone for RTCErrorEvent
impl Clone for RTCErrorEvent
Source§fn clone(&self) -> RTCErrorEvent
fn clone(&self) -> RTCErrorEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more