pub struct ElementContentEditable(/* private fields */);
Implementations§
Source§impl ElementContentEditable
impl ElementContentEditable
pub fn get_is_content_editable(&self) -> JsBoolean
pub fn set_is_content_editable(&self, value: &dyn ToJs<JsBoolean>)
pub fn get_input_mode(&self) -> JsString
pub fn set_input_mode(&self, value: &dyn ToJs<JsString>)
pub fn get_enter_key_hint(&self) -> JsString
pub fn set_enter_key_hint(&self, value: &dyn ToJs<JsString>)
pub fn get_content_editable(&self) -> JsString
pub fn set_content_editable(&self, value: &dyn ToJs<JsString>)
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<ElementContentEditable> for HTMLAnchorElement
impl AsRef<ElementContentEditable> for HTMLAnchorElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLAreaElement
impl AsRef<ElementContentEditable> for HTMLAreaElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLAudioElement
impl AsRef<ElementContentEditable> for HTMLAudioElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLBRElement
impl AsRef<ElementContentEditable> for HTMLBRElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLBaseElement
impl AsRef<ElementContentEditable> for HTMLBaseElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLBodyElement
impl AsRef<ElementContentEditable> for HTMLBodyElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLButtonElement
impl AsRef<ElementContentEditable> for HTMLButtonElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLCanvasElement
impl AsRef<ElementContentEditable> for HTMLCanvasElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDListElement
impl AsRef<ElementContentEditable> for HTMLDListElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDataElement
impl AsRef<ElementContentEditable> for HTMLDataElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDataListElement
impl AsRef<ElementContentEditable> for HTMLDataListElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDetailsElement
impl AsRef<ElementContentEditable> for HTMLDetailsElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDialogElement
impl AsRef<ElementContentEditable> for HTMLDialogElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDirectoryElement
impl AsRef<ElementContentEditable> for HTMLDirectoryElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLDivElement
impl AsRef<ElementContentEditable> for HTMLDivElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLElement
impl AsRef<ElementContentEditable> for HTMLElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLEmbedElement
impl AsRef<ElementContentEditable> for HTMLEmbedElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLFieldSetElement
impl AsRef<ElementContentEditable> for HTMLFieldSetElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLFontElement
impl AsRef<ElementContentEditable> for HTMLFontElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLFormElement
impl AsRef<ElementContentEditable> for HTMLFormElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLFrameElement
impl AsRef<ElementContentEditable> for HTMLFrameElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLFrameSetElement
impl AsRef<ElementContentEditable> for HTMLFrameSetElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLHRElement
impl AsRef<ElementContentEditable> for HTMLHRElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLHeadElement
impl AsRef<ElementContentEditable> for HTMLHeadElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLHeadingElement
impl AsRef<ElementContentEditable> for HTMLHeadingElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLHtmlElement
impl AsRef<ElementContentEditable> for HTMLHtmlElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLIFrameElement
impl AsRef<ElementContentEditable> for HTMLIFrameElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLImageElement
impl AsRef<ElementContentEditable> for HTMLImageElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLInputElement
impl AsRef<ElementContentEditable> for HTMLInputElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLLIElement
impl AsRef<ElementContentEditable> for HTMLLIElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLLabelElement
impl AsRef<ElementContentEditable> for HTMLLabelElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLLegendElement
impl AsRef<ElementContentEditable> for HTMLLegendElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLLinkElement
impl AsRef<ElementContentEditable> for HTMLLinkElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLMapElement
impl AsRef<ElementContentEditable> for HTMLMapElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLMarqueeElement
impl AsRef<ElementContentEditable> for HTMLMarqueeElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLMediaElement
impl AsRef<ElementContentEditable> for HTMLMediaElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLMenuElement
impl AsRef<ElementContentEditable> for HTMLMenuElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLMetaElement
impl AsRef<ElementContentEditable> for HTMLMetaElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLMeterElement
impl AsRef<ElementContentEditable> for HTMLMeterElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLModElement
impl AsRef<ElementContentEditable> for HTMLModElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLOListElement
impl AsRef<ElementContentEditable> for HTMLOListElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLObjectElement
impl AsRef<ElementContentEditable> for HTMLObjectElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLOptGroupElement
impl AsRef<ElementContentEditable> for HTMLOptGroupElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLOptionElement
impl AsRef<ElementContentEditable> for HTMLOptionElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLOutputElement
impl AsRef<ElementContentEditable> for HTMLOutputElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLParagraphElement
impl AsRef<ElementContentEditable> for HTMLParagraphElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLParamElement
impl AsRef<ElementContentEditable> for HTMLParamElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLPictureElement
impl AsRef<ElementContentEditable> for HTMLPictureElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLPreElement
impl AsRef<ElementContentEditable> for HTMLPreElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLProgressElement
impl AsRef<ElementContentEditable> for HTMLProgressElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLQuoteElement
impl AsRef<ElementContentEditable> for HTMLQuoteElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLScriptElement
impl AsRef<ElementContentEditable> for HTMLScriptElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLSelectElement
impl AsRef<ElementContentEditable> for HTMLSelectElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLSlotElement
impl AsRef<ElementContentEditable> for HTMLSlotElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLSourceElement
impl AsRef<ElementContentEditable> for HTMLSourceElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLSpanElement
impl AsRef<ElementContentEditable> for HTMLSpanElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLStyleElement
impl AsRef<ElementContentEditable> for HTMLStyleElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableCaptionElement
impl AsRef<ElementContentEditable> for HTMLTableCaptionElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableCellElement
impl AsRef<ElementContentEditable> for HTMLTableCellElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableColElement
impl AsRef<ElementContentEditable> for HTMLTableColElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableDataCellElement
impl AsRef<ElementContentEditable> for HTMLTableDataCellElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableElement
impl AsRef<ElementContentEditable> for HTMLTableElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableHeaderCellElement
impl AsRef<ElementContentEditable> for HTMLTableHeaderCellElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableRowElement
impl AsRef<ElementContentEditable> for HTMLTableRowElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTableSectionElement
impl AsRef<ElementContentEditable> for HTMLTableSectionElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTemplateElement
impl AsRef<ElementContentEditable> for HTMLTemplateElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTextAreaElement
impl AsRef<ElementContentEditable> for HTMLTextAreaElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTimeElement
impl AsRef<ElementContentEditable> for HTMLTimeElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTitleElement
impl AsRef<ElementContentEditable> for HTMLTitleElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLTrackElement
impl AsRef<ElementContentEditable> for HTMLTrackElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLUListElement
impl AsRef<ElementContentEditable> for HTMLUListElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLUnknownElement
impl AsRef<ElementContentEditable> for HTMLUnknownElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<ElementContentEditable> for HTMLVideoElement
impl AsRef<ElementContentEditable> for HTMLVideoElement
Source§fn as_ref(&self) -> &ElementContentEditable
fn as_ref(&self) -> &ElementContentEditable
Source§impl AsRef<JsObject> for ElementContentEditable
impl AsRef<JsObject> for ElementContentEditable
Source§impl AsRef<JsValue> for ElementContentEditable
impl AsRef<JsValue> for ElementContentEditable
Source§impl Clone for ElementContentEditable
impl Clone for ElementContentEditable
Source§fn clone(&self) -> ElementContentEditable
fn clone(&self) -> ElementContentEditable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more