Struct CDATASection

Source
pub struct CDATASection(/* private fields */);

Implementations§

Methods from Deref<Target = Text>§

Source

pub fn split_text(&self, offset: &dyn ToJs<JsNumber>) -> Text

Source

pub fn get_assigned_slot(&self) -> JsNullable<HTMLSlotElement>

Source

pub fn set_assigned_slot(&self, value: &dyn ToJs<JsNullable<HTMLSlotElement>>)

Source

pub fn get_whole_text(&self) -> JsString

Source

pub fn set_whole_text(&self, value: &dyn ToJs<JsString>)

Methods from Deref<Target = CharacterData>§

Source

pub fn remove(&self) -> JsNullish

Source

pub fn replace_with(&self, nodes: &dyn ToJs<Array<JsValue>>) -> JsNullish

Source

pub fn before(&self, nodes: &dyn ToJs<Array<JsValue>>) -> JsNullish

Source

pub fn after(&self, nodes: &dyn ToJs<Array<JsValue>>) -> JsNullish

Source

pub fn append_data(&self, data: &dyn ToJs<JsString>) -> JsNullish

Source

pub fn substring_data( &self, offset: &dyn ToJs<JsNumber>, count: &dyn ToJs<JsNumber>, ) -> JsString

Source

pub fn insert_data( &self, offset: &dyn ToJs<JsNumber>, data: &dyn ToJs<JsString>, ) -> JsNullish

Source

pub fn delete_data( &self, offset: &dyn ToJs<JsNumber>, count: &dyn ToJs<JsNumber>, ) -> JsNullish

Source

pub fn replace_data( &self, offset: &dyn ToJs<JsNumber>, count: &dyn ToJs<JsNumber>, data: &dyn ToJs<JsString>, ) -> JsNullish

Source

pub fn get_previous_element_sibling(&self) -> JsNullable<Element>

Source

pub fn set_previous_element_sibling( &self, value: &dyn ToJs<JsNullable<Element>>, )

Source

pub fn get_next_element_sibling(&self) -> JsNullable<Element>

Source

pub fn set_next_element_sibling(&self, value: &dyn ToJs<JsNullable<Element>>)

Source

pub fn get_owner_document(&self) -> Document

Source

pub fn set_owner_document(&self, value: &Document)

Source

pub fn get_length(&self) -> JsNumber

Source

pub fn set_length(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_data(&self) -> JsString

Source

pub fn set_data(&self, value: &dyn ToJs<JsString>)

Methods from Deref<Target = Node>§

Source

pub fn normalize(&self) -> JsNullish

Source

pub fn has_child_nodes(&self) -> JsBoolean

Source

pub fn remove_child<T: JsCast + AsRef<Node> + Into<Node>>( &self, child: &dyn ToJs<T>, ) -> T

Source

pub fn lookup_prefix( &self, namespace: &dyn ToJs<JsNullable<JsString>>, ) -> JsNullable<JsString>

Source

pub fn lookup_namespace_uri( &self, prefix: &dyn ToJs<JsNullable<JsString>>, ) -> JsNullable<JsString>

Source

pub fn is_same_node(&self, otherNode: &dyn ToJs<JsNullable<Node>>) -> JsBoolean

Source

pub fn is_equal_node(&self, otherNode: &dyn ToJs<JsNullable<Node>>) -> JsBoolean

Source

pub fn is_default_namespace( &self, namespace: &dyn ToJs<JsNullable<JsString>>, ) -> JsBoolean

Source

pub fn get_root_node( &self, options: &dyn ToJs<JsNullable<GetRootNodeOptions>>, ) -> Node

Source

pub fn contains(&self, other: &dyn ToJs<JsNullable<Node>>) -> JsBoolean

Source

pub fn compare_document_position(&self, other: &Node) -> JsNumber

Source

pub fn clone_node(&self, deep: &dyn ToJs<JsNullable<JsBoolean>>) -> Node

Source

pub fn append_child<T: JsCast + AsRef<Node> + Into<Node>>( &self, node: &dyn ToJs<T>, ) -> T

Source

pub fn replace_child<T: JsCast + AsRef<Node> + Into<Node>>( &self, node: &Node, child: &dyn ToJs<T>, ) -> T

Source

pub fn insert_before<T: JsCast + AsRef<Node> + Into<Node>>( &self, node: &dyn ToJs<T>, child: &dyn ToJs<JsNullable<Node>>, ) -> T

Source

pub fn get_document__position__implementation__specific(&self) -> JsNumber

Source

pub fn set_document__position__implementation__specific( &self, value: &dyn ToJs<JsNumber>, )

Source

pub fn get_document__position__contained__by(&self) -> JsNumber

Source

pub fn set_document__position__contained__by(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__position__contains(&self) -> JsNumber

Source

pub fn set_document__position__contains(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__position__following(&self) -> JsNumber

Source

pub fn set_document__position__following(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__position__preceding(&self) -> JsNumber

Source

pub fn set_document__position__preceding(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__position__disconnected(&self) -> JsNumber

Source

pub fn set_document__position__disconnected(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_notation__node(&self) -> JsNumber

Source

pub fn set_notation__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__fragment__node(&self) -> JsNumber

Source

pub fn set_document__fragment__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__type__node(&self) -> JsNumber

Source

pub fn set_document__type__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_document__node(&self) -> JsNumber

Source

pub fn set_document__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_comment__node(&self) -> JsNumber

Source

pub fn set_comment__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_processing__instruction__node(&self) -> JsNumber

Source

pub fn set_processing__instruction__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_entity__node(&self) -> JsNumber

Source

pub fn set_entity__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_entity__reference__node(&self) -> JsNumber

Source

pub fn set_entity__reference__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_cdata__section__node(&self) -> JsNumber

Source

pub fn set_cdata__section__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_text__node(&self) -> JsNumber

Source

pub fn set_text__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_attribute__node(&self) -> JsNumber

Source

pub fn set_attribute__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_element__node(&self) -> JsNumber

Source

pub fn set_element__node(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_text_content(&self) -> JsNullable<JsString>

Source

pub fn set_text_content(&self, value: &dyn ToJs<JsNullable<JsString>>)

Source

pub fn get_previous_sibling(&self) -> JsNullable<ChildNode>

Source

pub fn set_previous_sibling(&self, value: &dyn ToJs<JsNullable<ChildNode>>)

Source

pub fn get_parent_node(&self) -> JsNullable<ParentNode>

Source

pub fn set_parent_node(&self, value: &dyn ToJs<JsNullable<ParentNode>>)

Source

pub fn get_parent_element(&self) -> JsNullable<HTMLElement>

Source

pub fn set_parent_element(&self, value: &dyn ToJs<JsNullable<HTMLElement>>)

Source

pub fn get_owner_document(&self) -> JsNullable<Document>

Source

pub fn set_owner_document(&self, value: &dyn ToJs<JsNullable<Document>>)

Source

pub fn get_node_value(&self) -> JsNullable<JsString>

Source

pub fn set_node_value(&self, value: &dyn ToJs<JsNullable<JsString>>)

Source

pub fn get_node_type(&self) -> JsNumber

Source

pub fn set_node_type(&self, value: &dyn ToJs<JsNumber>)

Source

pub fn get_node_name(&self) -> JsString

Source

pub fn set_node_name(&self, value: &dyn ToJs<JsString>)

Source

pub fn get_next_sibling(&self) -> JsNullable<ChildNode>

Source

pub fn set_next_sibling(&self, value: &dyn ToJs<JsNullable<ChildNode>>)

Source

pub fn get_last_child(&self) -> JsNullable<ChildNode>

Source

pub fn set_last_child(&self, value: &dyn ToJs<JsNullable<ChildNode>>)

Source

pub fn get_is_connected(&self) -> JsBoolean

Source

pub fn set_is_connected(&self, value: &dyn ToJs<JsBoolean>)

Source

pub fn get_first_child(&self) -> JsNullable<ChildNode>

Source

pub fn set_first_child(&self, value: &dyn ToJs<JsNullable<ChildNode>>)

Source

pub fn get_child_nodes(&self) -> NodeListOf<ChildNode>

Source

pub fn set_child_nodes(&self, value: &dyn ToJs<NodeListOf<ChildNode>>)

Source

pub fn get_base_uri(&self) -> JsString

Source

pub fn set_base_uri(&self, value: &dyn ToJs<JsString>)

Methods from Deref<Target = EventTarget>§

Source

pub fn dispatch_event(&self, event: &Event) -> JsBoolean

Source

pub fn remove_event_listener( &self, type_: &dyn ToJs<JsString>, callback: &dyn ToJs<JsNullable<JsValue>>, options: &dyn ToJs<JsNullable<JsValue>>, ) -> JsNullish

Source

pub fn add_event_listener( &self, type_: &dyn ToJs<JsString>, callback: &dyn ToJs<JsNullable<JsValue>>, options: &dyn ToJs<JsNullable<JsValue>>, ) -> JsNullish

Methods from Deref<Target = JsObject>§

Source

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();
}
Source

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");
}
Source

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).

Source

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>§

Source

pub fn browser(&self) -> &Browser

Source

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<CDATASection> for CDATASection

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CharacterData> for CDATASection

Source§

fn as_ref(&self) -> &CharacterData

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<ChildNode> for CDATASection

Source§

fn as_ref(&self) -> &ChildNode

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<EventTarget> for CDATASection

Source§

fn as_ref(&self) -> &EventTarget

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsObject> for CDATASection

Source§

fn as_ref(&self) -> &JsObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<JsValue> for CDATASection

Source§

fn as_ref(&self) -> &JsValue

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Node> for CDATASection

Source§

fn as_ref(&self) -> &Node

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<NonDocumentTypeChildNode> for CDATASection

Source§

fn as_ref(&self) -> &NonDocumentTypeChildNode

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Slottable> for CDATASection

Source§

fn as_ref(&self) -> &Slottable

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<Text> for CDATASection

Source§

fn as_ref(&self) -> &Text

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for CDATASection

Source§

fn clone(&self) -> CDATASection

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Deref for CDATASection

Source§

type Target = Text

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Into<CharacterData> for CDATASection

Source§

fn into(self) -> CharacterData

Converts this type into the (usually inferred) input type.
Source§

impl Into<ChildNode> for CDATASection

Source§

fn into(self) -> ChildNode

Converts this type into the (usually inferred) input type.
Source§

impl Into<EventTarget> for CDATASection

Source§

fn into(self) -> EventTarget

Converts this type into the (usually inferred) input type.
Source§

impl Into<JsObject> for CDATASection

Source§

fn into(self) -> JsObject

Converts this type into the (usually inferred) input type.
Source§

impl Into<JsValue> for CDATASection

Source§

fn into(self) -> JsValue

Converts this type into the (usually inferred) input type.
Source§

impl Into<Node> for CDATASection

Source§

fn into(self) -> Node

Converts this type into the (usually inferred) input type.
Source§

impl Into<NonDocumentTypeChildNode> for CDATASection

Source§

fn into(self) -> NonDocumentTypeChildNode

Converts this type into the (usually inferred) input type.
Source§

impl Into<Slottable> for CDATASection

Source§

fn into(self) -> Slottable

Converts this type into the (usually inferred) input type.
Source§

impl Into<Text> for CDATASection

Source§

fn into(self) -> Text

Converts this type into the (usually inferred) input type.
Source§

impl JsCast for CDATASection

Source§

fn unchecked_from_js(val: JsValue) -> Self

Source§

fn unchecked_from_js_ref(val: &JsValue) -> &Self

Source§

fn unchecked_into<T>(self) -> T
where T: JsCast,

Source§

fn unchecked_ref<T>(&self) -> &T
where T: JsCast,

Source§

impl RefCast for CDATASection

Source§

type From = JsValue

Source§

fn ref_cast(_from: &Self::From) -> &Self

Source§

fn ref_cast_mut(_from: &mut Self::From) -> &mut Self

Source§

impl UseInJsCode for CDATASection

Source§

fn serialize_to(&self, buf: &mut Formatter<'_>) -> Result

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ToJs<T> for T
where T: UseInJsCode + ?Sized,