Struct fungui::Node

source ·
pub struct Node<E: Extension> { /* private fields */ }
Expand description

A node representing an element or text.

Can be cloned to duplicate the reference to the node.

Implementations§

Creates a new element with the given name.

Creates a new text node with the given text.

Returns an immutable reference to the node’s inner value

Returns an mutable reference to the node’s inner value

Adds the passed node as a child to this node before other child nodes.

Returns true if the node was added

Adds the passed node as a child to this node.

Returns true if the node was added

Removes the passed node as a child from this node.

Returns true if the node was removed

Returns a vector containing the child nodes of this node.

Returns the parent node of this node.

Returns the name of the node if it has one

Returns whether the passed node points to the same node as this one

Returns the text of the node if it is a text node.

Sets the text of the node if it is a text node.

Returns whether this node has had its layout computed at least once

Returns the raw position of the node.

This position isn’t transformed and is relative to the parent instead of absolute like render_position

Returns the rendering position of the node.

Useful for IME handling. Must be called after a layout call.

Removes the property on the node.

Returns a copy of the value for the given property if it exists.

Returns a reference to the value for the given property if it exists.

Sets the value of a given property

Sets the value of a given property without flagging the node as changed.

This is useful for when properties are use as storage and not used in style rules.

As a general convention this properties should use keys begining with $ (e.g. $cycle) as these are not accepted by the style parser.

Creates a weak reference to this node.

Begins a query on this node

Creates a node from a string

Creates a node from a parsed document.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

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
Uses borrowed data to replace owned data, usually by cloning. 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.