Struct stdweb::web::Node [] [src]

pub struct Node(_);

A reference to a JavaScript object which implements the INode interface.

(JavaScript docs)

Methods

impl Node
[src]

[src]

Attempt to create the Node from raw html. The html string must contain exactly one root node.

Returns a SyntaxError if:

  • There is not exactly one root node.
  • The html syntax is wrong. However, on most browsers the html parsing algorighm is unbelievably forgiving and will just turn your html into text or maybe even an empty string.

It is recommended to have control over the html being given to this function as not having control is a security concern.

For more details, see information about setting innerHTML:

https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML

Trait Implementations

impl From<Document> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for Document
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl Clone for Node
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Node
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for Node
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for Node
[src]

impl From<Node> for EventTarget
[src]

[src]

Performs the conversion.

impl TryFrom<EventTarget> for Node
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl InstanceOf for Node
[src]

[src]

Checks whenever a given Reference if of type Self.

impl AsRef<Reference> for Node
[src]

[src]

Performs the conversion.

impl ReferenceType for Node
[src]

[src]

Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more

impl From<Node> for Reference
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for Reference
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl TryFrom<Reference> for Node
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl<'_r> TryFrom<&'_r Reference> for Node
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl TryFrom<Value> for Node
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl<'_r> TryFrom<&'_r Value> for Node
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl JsSerialize for Node
[src]

impl IEventTarget for Node
[src]

[src]

Adds given event handler to the list of event listeners for the specified EventTarget on which it's called. Read more

[src]

Dispatches an Event at this EventTarget, invoking the affected event listeners in the appropriate order. Read more

impl INode for Node
[src]

[src]

Casts a reference to this object into a reference to a Node.

[src]

Adds a node to the end of the list of children of a specified parent node. Read more

[src]

Removes a child node from the DOM. Read more

[src]

Returns a duplicate of the node on which this method was called. Read more

[src]

Checks whenever a given node is a descendant of this one or not. Read more

[src]

Inserts the specified node before the reference node as a child of the current node. Read more

[src]

Replaces one hild node of the specified node with another. Read more

[src]

Returns the parent of this node in the DOM tree. Read more

[src]

Returns the node's first child in the tree, or None if the node is childless. Read more

[src]

Returns the node's last child in the tree, or None if the node is childless. Read more

[src]

Returns the node's next sibling in the tree, or None if there isn't such a node. Read more

[src]

Returns the name of the node. Read more

[src]

Returns the type of the node. Read more

[src]

Returns the value of the node. Read more

[src]

Sets the value of the node. Read more

[src]

Returns the Document that this node belongs to. Read more

[src]

Returns an Element that is the parent of this node. Returns null if the node has no parent or the parent is not an Element. Read more

[src]

Returns the node's previous sibling in the tree, or None if there isn't such a node. Read more

[src]

A property which represents the text content of a node and its descendants. Read more

[src]

Sets the text content of this node; calling thil removes all of node's children and replaces them with a single text node with the given value. Read more

[src]

Returns a live collection of child nodes of this node. Read more

[src]

Gets the base URL. Read more

[src]

Returns whether this node has children nodes. Read more

[src]

Determines whether the given namespace is the default namespace of this node. Read more

[src]

Tests whether this node is equal to another node. Two nodes are equal if they have the same type, defining characteristics, matching attributes, and so on. Read more

[src]

Test whether two Node references are the same. Read more

[src]

Returns the prefix for the given namespace URI, if present. Read more

[src]

Returns the namespace URI for the given prefix. Read more

[src]

Merges any adjacent text nodes and removes empty text nodes under this node. Read more

impl From<Element> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for Element
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<HtmlElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for HtmlElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<CanvasElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for CanvasElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<ImageElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for ImageElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<InputElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for InputElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<TextAreaElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for TextAreaElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<SelectElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for SelectElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<OptionElement> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for OptionElement
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<DocumentFragment> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for DocumentFragment
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

impl From<TextNode> for Node
[src]

[src]

Performs the conversion.

impl TryFrom<Node> for TextNode
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

Auto Trait Implementations

impl Send for Node

impl Sync for Node