[−][src]Struct stdweb::web::Node
A reference to a JavaScript object which implements the INode interface.
Methods
impl Node
[src]
impl Node
pub fn from_html(html: &str) -> Result<Node, SyntaxError> | [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 JsSerialize for Node
[src]
impl JsSerialize for Node
impl TryFrom<Node> for Document
[src]
impl TryFrom<Node> for Document
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<EventTarget> for Node
[src]
impl TryFrom<EventTarget> for Node
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: EventTarget) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for Reference
[src]
impl TryFrom<Node> for Reference
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Reference> for Node
[src]
impl TryFrom<Reference> for Node
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error> | [src] |
impl<'_r> TryFrom<&'_r Reference> for Node
[src]
impl<'_r> TryFrom<&'_r Reference> for Node
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Value> for Node
[src]
impl TryFrom<Value> for Node
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error> | [src] |
impl<'_r> TryFrom<&'_r Value> for Node
[src]
impl<'_r> TryFrom<&'_r Value> for Node
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for Element
[src]
impl TryFrom<Node> for Element
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for HtmlElement
[src]
impl TryFrom<Node> for HtmlElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for CanvasElement
[src]
impl TryFrom<Node> for CanvasElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for ImageElement
[src]
impl TryFrom<Node> for ImageElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for InputElement
[src]
impl TryFrom<Node> for InputElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for TextAreaElement
[src]
impl TryFrom<Node> for TextAreaElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for SelectElement
[src]
impl TryFrom<Node> for SelectElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for OptionElement
[src]
impl TryFrom<Node> for OptionElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for TemplateElement
[src]
impl TryFrom<Node> for TemplateElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for SlotElement
[src]
impl TryFrom<Node> for SlotElement
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for DocumentFragment
[src]
impl TryFrom<Node> for DocumentFragment
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for TextNode
[src]
impl TryFrom<Node> for TextNode
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl TryFrom<Node> for ShadowRoot
[src]
impl TryFrom<Node> for ShadowRoot
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Node) -> Result<Self, Self::Error> | [src] |
impl InstanceOf for Node
[src]
impl InstanceOf for Node
fn instance_of(reference: &Reference) -> bool | [src] |
impl ReferenceType for Node
[src]
impl ReferenceType for Node
unsafe fn from_reference_unchecked(reference: Reference) -> Self | [src] |
impl IEventTarget for Node
[src]
impl IEventTarget for Node
fn add_event_listener<T, F>(&self, listener: F) -> EventListenerHandle where | [src] |
Adds given event handler to the list of event listeners for the specified EventTarget
on which it's called. Read more
fn dispatch_event<T: IEvent>(&self, event: &T) -> Result<bool, TODO> | [src] |
Dispatches an Event
at this EventTarget
, invoking the affected event listeners in the appropriate order. Read more
impl INode for Node
[src]
impl INode for Node
fn as_node(&self) -> &Node | [src] |
Casts a reference to this object into a reference to a Node.
fn append_child<T: INode>(&self, child: &T) | [src] |
Adds a node to the end of the list of children of a specified parent node. Read more
fn remove_child<T: INode>(&self, child: &T) -> Result<Node, NotFoundError> | [src] |
Removes a child node from the DOM. Read more
fn clone_node(&self, kind: CloneKind) -> Result<Self, TODO> | [src] |
Returns a duplicate of the node on which this method was called. Read more
fn contains<T: INode>(&self, node: &T) -> bool | [src] |
Checks whenever a given node is a descendant of this one or not. Read more
fn insert_before<T: INode, U: INode>( | [src] |
Inserts the specified node before the reference node as a child of the current node. Read more
fn replace_child<T: INode, U: INode>( | [src] |
Replaces one hild node of the specified node with another. Read more
fn parent_node(&self) -> Option<Node> | [src] |
Returns the parent of this node in the DOM tree. Read more
fn first_child(&self) -> Option<Node> | [src] |
Returns the node's first child in the tree, or None
if the node is childless. Read more
fn last_child(&self) -> Option<Node> | [src] |
Returns the node's last child in the tree, or None
if the node is childless. Read more
fn next_sibling(&self) -> Option<Node> | [src] |
Returns the node's next sibling in the tree, or None
if there isn't such a node. Read more
fn node_name(&self) -> String | [src] |
Returns the name of the node. Read more
fn node_type(&self) -> NodeType | [src] |
Returns the type of the node. Read more
fn node_value(&self) -> Option<String> | [src] |
Returns the value of the node. Read more
fn set_node_value(&self, value: Option<&str>) | [src] |
Sets the value of the node. Read more
fn owner_document(&self) -> Option<Document> | [src] |
Returns the Document
that this node belongs to. Read more
fn parent_element(&self) -> Option<Element> | [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
fn previous_sibling(&self) -> Option<Node> | [src] |
Returns the node's previous sibling in the tree, or None
if there isn't such a node. Read more
fn text_content(&self) -> Option<String> | [src] |
A property which represents the text content of a node and its descendants. Read more
fn set_text_content(&self, text: &str) | [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
fn child_nodes(&self) -> NodeList | [src] |
Returns a live collection of child nodes of this node. Read more
fn base_uri(&self) -> String | [src] |
Gets the base URL. Read more
fn has_child_nodes(&self) -> bool | [src] |
Returns whether this node has children nodes. Read more
fn is_default_namespace(&self, namespace: &str) -> bool | [src] |
Determines whether the given namespace is the default namespace of this node. Read more
fn is_equal_node<T: INode>(&self, node: &T) -> bool | [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
fn is_same_node<T: INode>(&self, node: &T) -> bool | [src] |
Test whether two Node
references are the same. Read more
fn lookup_prefix(&self, namespace: &str) -> Option<String> | [src] |
Returns the prefix for the given namespace URI, if present. Read more
fn lookup_namespace_uri(&self, prefix: &str) -> Option<String> | [src] |
Returns the namespace URI for the given prefix. Read more
fn normalize(&self) | [src] |
Merges any adjacent text nodes and removes empty text nodes under this node. Read more
impl AsRef<Reference> for Node
[src]
impl AsRef<Reference> for Node
impl Clone for Node
[src]
impl Clone for Node
fn clone(&self) -> Node | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl From<Document> for Node
[src]
impl From<Document> for Node
impl From<Node> for EventTarget
[src]
impl From<Node> for EventTarget
impl From<Node> for Reference
[src]
impl From<Node> for Reference
impl From<Element> for Node
[src]
impl From<Element> for Node
impl From<HtmlElement> for Node
[src]
impl From<HtmlElement> for Node
fn from(value: HtmlElement) -> Self | [src] |
impl From<CanvasElement> for Node
[src]
impl From<CanvasElement> for Node
fn from(value: CanvasElement) -> Self | [src] |
impl From<ImageElement> for Node
[src]
impl From<ImageElement> for Node
fn from(value: ImageElement) -> Self | [src] |
impl From<InputElement> for Node
[src]
impl From<InputElement> for Node
fn from(value: InputElement) -> Self | [src] |
impl From<TextAreaElement> for Node
[src]
impl From<TextAreaElement> for Node
fn from(value: TextAreaElement) -> Self | [src] |
impl From<SelectElement> for Node
[src]
impl From<SelectElement> for Node
fn from(value: SelectElement) -> Self | [src] |
impl From<OptionElement> for Node
[src]
impl From<OptionElement> for Node
fn from(value: OptionElement) -> Self | [src] |
impl From<TemplateElement> for Node
[src]
impl From<TemplateElement> for Node
fn from(value: TemplateElement) -> Self | [src] |
impl From<SlotElement> for Node
[src]
impl From<SlotElement> for Node
fn from(value: SlotElement) -> Self | [src] |
impl From<DocumentFragment> for Node
[src]
impl From<DocumentFragment> for Node
fn from(value: DocumentFragment) -> Self | [src] |
impl From<TextNode> for Node
[src]
impl From<TextNode> for Node
impl From<ShadowRoot> for Node
[src]
impl From<ShadowRoot> for Node
fn from(value: ShadowRoot) -> Self | [src] |
impl Eq for Node
[src]
impl Eq for Node
impl PartialEq<Node> for Node
[src]
impl PartialEq<Node> for Node
impl Debug for Node
[src]
impl Debug for Node
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |