logo
pub struct Element { /* private fields */ }
Expand description

DOM element wrapper. See the module-level documentation also.

Implementations

Create a new element, it is disconnected initially from the DOM.

Create new element as child of parent.

👎 Deprecated since 0.5.0:

please use Element::with_parent() instead.

Create new element as child of parent. Deprecated.

Create new element with specified text, it is disconnected initially from the DOM.

Create new element with specified type, which is useful for controls and widgets (initially disconnected).

Get the root DOM element of the Sciter document.

If there is no document loaded, this function will return an error.

Get focus DOM element of the Sciter document.

If there is no such element, this function will return an error.

Get highlighted element.

If there is no such element, this function will return an error.

Find DOM element of the Sciter document by coordinates.

If there is no such element, this function will return an error.

Get element handle by its UID.

If there is no such element, this function will return an error.

Access element pointer.

Get element UID - identifier suitable for storage.

Return element tag as string (e.g. ‘div’, ‘body’).

Get inner text of the element as string.

Set inner text of the element.

Get html representation of the element as utf-8 bytes.

Set inner or outer html of the element.

Get value of the element.

Set value of the element.

Checks if particular UI state bits are set in the element.

Set UI state of the element with optional view update.

Get HWINDOW of containing window.

Attach a native window to the element as a child.

Detach a child native window (if any) from the element.

Get bounding rectangle of the element. See the ELEMENT_AREAS enum for kind flags.

Request data download for this element.

Request HTML data download for this element.

Send an asynchronous HTTP GET request for the element.

The contents of this element is replaced with the HTTP response (in text or html form).

Send an HTTP GET or POST request for the element.

GET params (if any) are appended to the url to form the request.
HTTP POST params are serialized as Content-Type: application/x-www-form-urlencoded;charset=utf-8;.

Sends sinking/bubbling event to the child/parent chain of the element.

Post asynchronously a sinking/bubbling event to the child/parent chain of the element.

Send or posts event to the child/parent chain of the element.

Send or posts event with specified params to the child/parent chain of the element.

Broadcast a custom named event to all windows.

Evaluate the given script in context of the element.

Call scripting function defined in the namespace of the element (a.k.a. global function).

You can use the make_args!(args...) macro which helps you to construct script arguments from Rust types.

Call scripting method defined for the element.

You can use the make_args!(args...) macro which helps you to construct script arguments from Rust types.

Call behavior specific method.

Get number of the attributes.

Get attribute name by its index.

Get attribute value by its index.

Get attribute value by its name.

Add or replace attribute.

Remove attribute.

Toggle attribute.

Remove all attributes from the element.

Get style attribute of the element by its name.

Get index of this element in its parent collection.

Get root of the element.

Get parent element.

Get first sibling element.

Get last sibling element.

Get next sibling element.

Get previous sibling element.

Get first child element.

Get last child element.

Get element’s child at specified index.

An iterator over the direct children of a DOM element.

Get element’s child at specified index.

Get number of child elements.

Get number of child elements.

Returns true is self has zero elements.

Clear content of the element.

Create new element as copy of existing element.

The new element is a full (deep) copy of the element and is initially disconnected from the DOM. Note that Element.clone() does not clone the DOM element, just increments its reference count.

Insert element at index position of this element.

Note that we cannot follow Rust semantic here because the newly created Element is unusable before it will be inserted at DOM.

Append element as last child of this element.

Append element as last child of this element.

Remove the last child from this element and returns it, or None if this element is empty.

Take element out of its container (and DOM tree).

Take element out of its container (and DOM tree) and force destruction of all behaviors.

Swap element positions.

Test this element against CSS selector(s).

Will find first parent element starting from this satisfying given css selector(s).

Will find first element starting from this satisfying given css selector(s).

Will find all elements starting from this satisfying given css selector(s).

Apply changes and refresh element area in its window.

Refresh element area in its window.

If the element has drawing behavior attached it will receive on_draw call after that.

Start Timer for the element.

Element will receive on_timer events.

Note that timer events are not bubbling, so you need attach handler to the target element directly.

Stop Timer for the element.

Attach the native event handler to this element.

Detach your handler from the element. Handlers identified by token from attach_handler() result.

Trait Implementations

Increment reference count of the dom element.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Machine-like element visualization ({:?} and {:#?}).

Formats the value using the given formatter. Read more

Human element representation.

Formats the value using the given formatter. Read more

Release element pointer.

Executes the destructor for this type. Read more

Construct an Element object from an HELEMENT handle.

Get an Element object contained in the Value.

Converts value to specified type.

Allows for child in &el {} enumeration.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Store the DOM element as a Value.

Since 4.4.3.26, perhaps.

The type returned in the event of a conversion error.

Performs the conversion.

sciter::Element can be transferred across thread boundaries.

It is safe to share sciter::Element between threads - underlaying API is thread-safe.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.