Struct conrod::graph::Graph [] [src]

pub struct Graph { /* fields omitted */ }

Stores the dynamic state of a UI tree of Widgets.

Methods

impl Graph
[src]

[src]

A new empty Graph.

[src]

A new Graph with the given node capacity.

We know that there can be no more than three parents per node as the public API enforces a maximum of one Depth, Position and Graphic parent each. Thus, we can assume an edge capacity of exactly three times the given node capacity.

[src]

Removes all Nodes and Edges from the Graph.

[src]

The total number of Nodes in the Graph.

[src]

The total number of Node::Widgets in the Graph.

[src]

The total number of Edges in the Graph.

[src]

The current capacity for the Graph's internal node Vec.

[src]

Add a new placeholder node and return it's widget::Id into the Graph.

This method is used by the widget::set_widget function when some internal widget does not yet have it's own widget::Id.

[src]

Borrow the node at the given widget::Id if there is one.

[src]

Mutably borrow the node at the given widget::Id if there is one.

[src]

Borrow the edge at the given EdgeIndex if there is one.

[src]

Mutably borrow the edge at the given EdgeIndex if there is one.

[src]

Return the parent and child nodes on either end of the Edge at the given index.

[src]

If there is a Widget for the given index, return a reference to it.

[src]

If there is a Widget for the given Id, return a mutable reference to it.

[src]

A Walker type that may be used to step through the parents of the given child node.

[src]

A Walker type that recursively walks the Graph using the given recursive_fn.

Panics If the given start index does not exist within the Graph.

[src]

If the widget at the given index has some parent along an Edge of the given variant, return an index to it.

[src]

Return the index of the parent along the given widget's Depth Edge.

[src]

Return the index of the parent along the given widget's Position Edge.

[src]

Return the index of the parent along the given widget's Position Edge.

[src]

Produces an iterator yielding the parents along both the X and Y Position Edges respectively.

[src]

Return the index of the parent along the given widget's Graphic Edge.

[src]

A Walker type that recursively walks Depth parents starting from the given node.

[src]

A Walker type that recursively walks X Position parents starting from the given node.

[src]

A Walker type that recursively walks Y Position parents starting from the given node.

[src]

A Walker type that recursively walks Graphic parents starting from the given node.

[src]

A Walker type that recursively walks Depth parents that are scrollable along the y axis for the given node.

[src]

A Walker type that recursively walks Depth parents that are scrollable along the x axis for the given node.

[src]

A Walker type that may be used to step through the children of the given parent node.

[src]

For walking the Depth children of the given parent node.

[src]

For walking the Position(X) children of the given parent node.

[src]

For walking the Position(Y) children of the given parent node.

[src]

For walking the Position children of the given parent node.

This first walks the Axis::X children, before walking the Axis::Y children.

[src]

For walking the Graphic children of the given parent node.

[src]

Does the given edge type exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

[src]

Does a Edge::Depth exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

[src]

Does a Edge::Position exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

[src]

Does a Edge::Graphic exist between the nodes parent -> child.

Returns false if either of the given node indices do not exist.

[src]

Are the given parent and child nodes connected by a single chain of edges of the given kind?

i.e. parent -> x -> y -> child.

Returns false if either of the given node indices do not exist.

[src]

Are the given parent and child nodes connected by a single chain of Depth edges?

i.e. parent -> x -> y -> child.

Returns false if either of the given node indices do not exist.

[src]

Are the given parent and child nodes connected by a single chain of Graphic edges?

i.e. parent -> x -> y -> child.

Returns false if either of the given node indices do not exist.

[src]

Cache some PreUpdateCache widget data into the graph.

This is called (via the ui module) from within the widget::set_widget function prior to the Widget::update method being called.

This is done so that if this Widget were to internally set some other Widgets within its own update method, this Widgets positioning and dimension data already exists within the Graph for reference.

[src]

Cache some PostUpdateCache widget data into the graph.

This is called (via the ui module) from within the widget::set_widget function after the Widget::update method is called and some new state is returned.

Trait Implementations

impl Debug for Graph
[src]

[src]

Formats the value using the given formatter.

impl Index<Id> for Graph
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl IndexMut<Id> for Graph
[src]

[src]

Performs the mutable indexing (container[index]) operation.

impl Index<EdgeIndex> for Graph
[src]

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

impl IndexMut<EdgeIndex> for Graph
[src]

[src]

Performs the mutable indexing (container[index]) operation.